Skip to content
Permalink
Browse files
A couple fixes for finding constants.
  • Loading branch information
brixen committed Feb 5, 2016
1 parent 3b1d167 commit 436d859e49880f953b2b8d86fd681739c899f48e
Showing with 16 additions and 9 deletions.
  1. +1 −9 core/io.rb
  2. +15 −0 core/zed.rb
@@ -80,16 +80,10 @@ class EINPROGRESSWaitWritable < Errno::EINPROGRESS
end

class FileDescriptor
@@max_descriptors = Rubinius::AtomicReference.new(2)

attr_reader :offset

O_RDONLY = Rubinius::Config['rbx.platform.file.O_RDONLY']
O_WRONLY = Rubinius::Config['rbx.platform.file.O_WRONLY']
O_RDWR = Rubinius::Config['rbx.platform.file.O_RDWR']

def self.choose_type(fd)
stat = Stat.fstat(fd)
stat = File::Stat.fstat(fd)

case stat.ftype
when "file"
@@ -854,8 +848,6 @@ def to_set
end
end

FD_SETSIZE = Rubinius::Config['rbx.platform.select.FD_SETSIZE']

def self.fd_set_from_array(array)
highest = -1
fd_set = FDSet.new
@@ -1108,6 +1108,7 @@ module Constants

# O_ACCMODE is /undocumented/ for fcntl() on some platforms
ACCMODE = Rubinius::Config['rbx.platform.fcntl.O_ACCMODE']
O_ACCMODE = Rubinius::Config['rbx.platform.fcntl.O_ACCMODE']

F_GETFD = Rubinius::Config['rbx.platform.fcntl.F_GETFD']
F_SETFD = Rubinius::Config['rbx.platform.fcntl.F_SETFD']
@@ -1203,6 +1204,20 @@ class IO
POSIX_FADV_WILLNEED = Rubinius::Config['rbx.platform.advise.POSIX_FADV_WILLNEED']
POSIX_FADV_DONTNEED = Rubinius::Config['rbx.platform.advise.POSIX_FADV_DONTNEED']
POSIX_FADV_NOREUSE = Rubinius::Config['rbx.platform.advise.POSIX_FADV_NOREUSE']

class FileDescriptor
@@max_descriptors = Rubinius::AtomicReference.new(2)

include File::Constants

O_RDONLY = Rubinius::Config['rbx.platform.file.O_RDONLY']
O_WRONLY = Rubinius::Config['rbx.platform.file.O_WRONLY']
O_RDWR = Rubinius::Config['rbx.platform.file.O_RDWR']
end

class Select
FD_SETSIZE = Rubinius::Config['rbx.platform.select.FD_SETSIZE']
end
end

class NilClass

0 comments on commit 436d859

Please sign in to comment.