From fabab8cb80ea87419afa7a1ccf4627e5e56da5e5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 7 Apr 2012 15:34:19 +0200 Subject: libusbmuxd: only fall back to polling if inotify setup fails --- libusbmuxd/libusbmuxd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c index 4c94dc2..4195960 100644 --- a/libusbmuxd/libusbmuxd.c +++ b/libusbmuxd/libusbmuxd.c @@ -422,7 +422,7 @@ static int usbmuxd_listen_inotify() inot_fd = inotify_init (); if (inot_fd < 0) { fprintf (stderr, "Failed to setup inotify\n"); - return -1; + return -2; } /* inotify is setup, listen for events that concern us */ @@ -430,7 +430,7 @@ static int usbmuxd_listen_inotify() if (watch_fd < 0) { fprintf (stderr, "Failed to setup watch for socket dir\n"); close (inot_fd); - return -1; + return -2; } while (1) { @@ -478,7 +478,7 @@ retry: #ifdef HAVE_INOTIFY sfd = usbmuxd_listen_inotify(); - if (sfd < 0) + if (sfd == -2) sfd = usbmuxd_listen_poll(); #else sfd = usbmuxd_listen_poll(); -- cgit v1.1-32-gdbae