class INotify::Notifier

def readpartial(size)

Same as IO#readpartial, or as close as we need.
def readpartial(size)
  readable, = select([@handle, @pipe.first])
  return nil if readable.include?(@pipe.first)
  @handle.readpartial(size)
rescue Errno::EBADF
  # If the IO has already been closed, reading from it will cause
  # Errno::EBADF.
  nil
end