You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rubygem-rb-inotify/rubygem-rb-inotify-0.9.7-Av...

24 lines
747 B

From 99d2101eaa71adc40737ae45cb03d3ae86fdad4a Mon Sep 17 00:00:00 2001
From: Cezary Baginski <cezary@chronomantic.net>
Date: Fri, 29 Jul 2016 13:26:22 +0200
Subject: [PATCH] avoid crashing on Ruby 2.3.1 when fd is closed
---
lib/rb-inotify/notifier.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/rb-inotify/notifier.rb b/lib/rb-inotify/notifier.rb
index c2f6ddc..516e78f 100644
--- a/lib/rb-inotify/notifier.rb
+++ b/lib/rb-inotify/notifier.rb
@@ -302,6 +302,9 @@ def readpartial(size)
# If the IO has already been closed, reading from it will cause
# Errno::EBADF.
return nil
+ rescue IOError => ex
+ return nil if ex.message =~ /stream closed/
+ raise
end
tries = 0