Skip to content
Permalink
Browse files
fix misuage of F_GETFL with F_GETFD
  • Loading branch information
chuckremes committed Oct 6, 2015
1 parent b62dcfa commit 77bd7748e79e95dc4f21109430118f8bf514935f
Showing 1 changed file with 1 addition and 1 deletion.
@@ -99,7 +99,7 @@ def self.new_open_fd(new_fd)
if new_fd > 2
flags = FFI::Platform::POSIX.fcntl(new_fd, F_GETFD, 0)
Errno.handle("fcntl(2) failed") if FFI.call_failed?(flags)
flags = FFI::Platform::POSIX.fcntl(new_fd, F_SETFD, get_flags(new_fd) | FD_CLOEXEC)
flags = FFI::Platform::POSIX.fcntl(new_fd, F_SETFD, flags | FD_CLOEXEC)
Errno.handle("fcntl(2) failed") if FFI.call_failed?(flags)
end

0 comments on commit 77bd774

Please sign in to comment.