summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-04-07 15:34:19 +0200
committerGravatar Nikias Bassen2012-04-07 15:34:19 +0200
commitfabab8cb80ea87419afa7a1ccf4627e5e56da5e5 (patch)
tree74b45cbf7dbdf31aeb24c554bf2f8fc4e1093923
parent4113b710122aeb213a872c467a9616e303188e04 (diff)
downloadusbmuxd-fabab8cb80ea87419afa7a1ccf4627e5e56da5e5.tar.gz
usbmuxd-fabab8cb80ea87419afa7a1ccf4627e5e56da5e5.tar.bz2
libusbmuxd: only fall back to polling if inotify setup fails
-rw-r--r--libusbmuxd/libusbmuxd.c6
1 files 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();