summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libusbmuxd/libusbmuxd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c
index d9cbd71..6d4504b 100644
--- a/libusbmuxd/libusbmuxd.c
+++ b/libusbmuxd/libusbmuxd.c
@@ -411,7 +411,7 @@ static int usbmuxd_listen_poll()
411static int usbmuxd_listen_inotify() 411static int usbmuxd_listen_inotify()
412{ 412{
413 int inot_fd; 413 int inot_fd;
414 int watch_fd; 414 int watch_d;
415 int sfd; 415 int sfd;
416 416
417 sfd = connect_usbmuxd_socket(); 417 sfd = connect_usbmuxd_socket();
@@ -426,9 +426,9 @@ static int usbmuxd_listen_inotify()
426 } 426 }
427 427
428 /* inotify is setup, listen for events that concern us */ 428 /* inotify is setup, listen for events that concern us */
429 watch_fd = inotify_add_watch (inot_fd, USBMUXD_DIRNAME, IN_CREATE); 429 watch_d = inotify_add_watch (inot_fd, USBMUXD_DIRNAME, IN_CREATE);
430 if (watch_fd < 0) { 430 if (watch_d < 0) {
431 fprintf (stderr, "Failed to setup watch for socket dir\n"); 431 fprintf (stderr, "Failed to setup watch descriptor for socket dir\n");
432 close (inot_fd); 432 close (inot_fd);
433 return -2; 433 return -2;
434 } 434 }
@@ -457,7 +457,7 @@ static int usbmuxd_listen_inotify()
457 } 457 }
458 458
459end: 459end:
460 close(watch_fd); 460 inotify_rm_watch(inot_fd, watch_d);
461 close(inot_fd); 461 close(inot_fd);
462 462
463 return sfd; 463 return sfd;