chiark / gitweb /
udev: timeout - warn after a third of the timeout before killing
[elogind.git] / src / udev / udevadm-settle.c
index 79e8b5990b65dfc65a8a71675ecd66b368766f47..ddcf1ddf9ae370494246a3cfacaad45cc0799e0b 100644 (file)
@@ -25,7 +25,6 @@
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <signal.h>
 #include <time.h>
@@ -44,8 +43,7 @@ static void help(void) {
                "  -h,--help\n\n");
 }
 
-static int adm_settle(struct udev *udev, int argc, char *argv[])
-{
+static int adm_settle(struct udev *udev, int argc, char *argv[]) {
         static const struct option options[] = {
                 { "seq-start",      required_argument, NULL, '\0' }, /* removed */
                 { "seq-end",        required_argument, NULL, '\0' }, /* removed */
@@ -135,7 +133,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[])
                 }
 
                 /* wake up when queue is empty */
-                if (poll(pfd, 1, 100) > 0 && pfd[0].revents & POLLIN)
+                if (poll(pfd, 1, MSEC_PER_SEC) > 0 && pfd[0].revents & POLLIN)
                         udev_queue_flush(queue);
         }