summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Hector Martin2009-04-28 02:13:12 +0200
committerGravatar Hector Martin2009-04-28 02:13:12 +0200
commitc2d46d901822c54a0677318522db62f30b8d5f04 (patch)
treec98b6fa1d654db978bcd756eba954786dfe2409f /main.c
parent2f6910a012f14e132565043b7f231373f6b8cc23 (diff)
downloadusbmuxd-c2d46d901822c54a0677318522db62f30b8d5f04.tar.gz
usbmuxd-c2d46d901822c54a0677318522db62f30b8d5f04.tar.bz2
poll on listenfd
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 6773d0e..bc846cc 100644
--- a/main.c
+++ b/main.c
@@ -80,6 +80,7 @@ int main_loop(int listenfd)
usbmuxd_log(LL_SPEW, "USB timeout is %d ms", to);
fdlist_create(&pollfds);
+ fdlist_add(&pollfds, FD_LISTEN, listenfd, POLLIN);
usb_get_fds(&pollfds);
usbmuxd_log(LL_SPEW, "fd count is %d", pollfds.count);
@@ -92,13 +93,15 @@ int main_loop(int listenfd)
return -1;
}
} else {
+ int done_usb = 0;
for(i=0; i<pollfds.count; i++) {
if(pollfds.fds[i].revents) {
- if(pollfds.owners[i] == FD_USB) {
+ if(!done_usb && pollfds.owners[i] == FD_USB) {
if(usb_process() < 0) {
usbmuxd_log(LL_FATAL, "usb_process() failed");
return -1;
}
+ done_usb = 1;
}
}
}