chiark / gitweb /
busctl: exit cleanly when the bus connection is severed
[elogind.git] / src / udev / udevadm-settle.c
index 79e8b5990b65dfc65a8a71675ecd66b368766f47..9eab8b2a21293ef90f08d89da5cfdcb1f952a462 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>
 #include "util.h"
 
 static void help(void) {
-        printf("Usage: udevadm settle OPTIONS\n"
-               "  -t,--timeout=<seconds>     maximum time to wait for events\n"
-               "  -E,--exit-if-exists=<file> stop waiting if file exists\n"
-               "  -h,--help\n\n");
+        printf("%s settle OPTIONS\n\n"
+               "Wait for pending udev events.\n\n"
+               "  -h --help                 Show this help\n"
+               "     --version              Show package version\n"
+               "  -t --timeout=SECONDS      Maximum time to wait for events\n"
+               "  -E --exit-if-exists=FILE  Stop waiting if file exists\n"
+               , program_invocation_short_name);
 }
 
-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 +136,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);
         }
 
@@ -147,5 +148,5 @@ out:
 const struct udevadm_cmd udevadm_settle = {
         .name = "settle",
         .cmd = adm_settle,
-        .help = "wait for pending udev events",
+        .help = "Wait for pending udev events",
 };