Permalink
Browse files

fix for nodejs/node-v0.x-archive#2920

  • Loading branch information...
bnoordhuis committed Mar 14, 2012
1 parent 3733a85 commit 275269dbe3709132c5d53276d7bebfb61bc8c10c
Showing with 8 additions and 4 deletions.
  1. +8 −4 deps/uv/src/unix/linux.c
View
@@ -170,11 +170,16 @@ uint64_t uv_get_total_memory(void) {
#if HAVE_INOTIFY_INIT || HAVE_INOTIFY_INIT1
static int new_inotify_fd(void) {
-#if HAVE_INOTIFY_INIT1
- return inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
-#else
int fd;
+#if HAVE_INOTIFY_INIT1
+ fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+ if (fd != -1)
+ return fd;
+ if (errno != ENOSYS)
+ return -1;
+#endif
+
if ((fd = inotify_init()) == -1)
return -1;
@@ -184,7 +189,6 @@ static int new_inotify_fd(void) {
}
return fd;
-#endif
}

0 comments on commit 275269d

Please sign in to comment.