diff options
Diffstat (limited to 'ext/sleepy_penguin/inotify.c')
-rw-r--r-- | ext/sleepy_penguin/inotify.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/sleepy_penguin/inotify.c b/ext/sleepy_penguin/inotify.c index b324227..b5cd67b 100644 --- a/ext/sleepy_penguin/inotify.c +++ b/ext/sleepy_penguin/inotify.c @@ -26,10 +26,8 @@ static VALUE s_new(int argc, VALUE *argv, VALUE klass) fd = inotify_init1(flags); if (fd < 0) { - if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) { - rb_gc(); + if (rb_sp_gc_for_fd(errno)) fd = inotify_init1(flags); - } if (fd < 0) rb_sys_fail("inotify_init1"); } |