Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aafdd94f235c
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 83020684c5ea
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Feb 26, 2016

  1. improve variable name

    chuckremes committed Feb 26, 2016
    Copy the full SHA
    04da6a5 View commit details
  2. Copy the full SHA
    8302068 View commit details
Showing with 6 additions and 5 deletions.
  1. +3 −2 core/io.rb
  2. +2 −2 vm/builtin/io.cpp
  3. +1 −1 vm/builtin/io.hpp
5 changes: 3 additions & 2 deletions core/io.rb
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ class EINPROGRESSWaitWritable < Errno::EINPROGRESS

class FileDescriptor
class RIOStream
def self.close(io, raise_exception)
def self.close(io, allow_exception)
Rubinius.primitive :rio_close
raise PrimitiveFailure, "IO::FileDescriptor::RIOStream.close primitive failed"
end
@@ -379,7 +379,8 @@ def close
fd = @descriptor

if fd != -1
RIOStream.close(@io, true)
# return early if this handle was promoted to a stream by a C-ext
return if RIOStream.close(@io, true)
ret_code = FFI::Platform::POSIX.close(fd)

if FFI.call_failed?(ret_code)
4 changes: 2 additions & 2 deletions vm/builtin/io.cpp
Original file line number Diff line number Diff line change
@@ -1538,14 +1538,14 @@ namespace rubinius {
G(rio_stream)->set_object_type(state, RIOStreamType);
}

Object* RIOStream::close(STATE, Object* io, Object* raise_exception) {
Object* RIOStream::close(STATE, Object* io, Object* allow_exception) {
// If there is a handle for this IO, and it's been promoted into
// a lowlevel RIO struct using fdopen, then we MUST use fclose
// to close it.

if(capi::Handle* hdl = io->handle(state)) {
if(hdl->is_rio()) {
if(!hdl->rio_close() && CBOOL(raise_exception)) {
if(!hdl->rio_close() && CBOOL(allow_exception)) {
Exception::errno_error(state);
}
return cTrue;
2 changes: 1 addition & 1 deletion vm/builtin/io.hpp
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@ namespace rubinius {
static void init(STATE);

// Rubinius.primitive :rio_close
static Object* close(STATE, Object* io, Object* raise_exception);
static Object* close(STATE, Object* io, Object* allow_exception);

class Info : public TypeInfo {
public: