diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-04-13 01:17:09 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-04-13 01:17:09 +0200 |
commit | ff2c503df091e6e4e9ab48cdb6df6ec8b7b525d0 (patch) | |
tree | 983bf55615a6bfeadc50f10355b286262e3ad188 /udev/udevadm-settle.c | |
parent | 960250952193db522b8ced336bf998bd7e8e4a31 (diff) |
udevadm: control - add --exit
Diffstat (limited to 'udev/udevadm-settle.c')
-rw-r--r-- | udev/udevadm-settle.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c index 1423cec6dc..b7852ff60a 100644 --- a/udev/udevadm-settle.c +++ b/udev/udevadm-settle.c @@ -44,8 +44,6 @@ static void sig_handler(int signum) switch (signum) { case SIGALRM: is_timeout = 1; - case SIGUSR1: - ; } } @@ -78,9 +76,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction(SIGALRM, &act, NULL); - sigaction(SIGUSR1, &act, NULL); sigemptyset(&mask); - sigaddset(&mask, SIGUSR1); sigaddset(&mask, SIGALRM); sigprocmask(SIG_UNBLOCK, &mask, NULL); @@ -168,15 +164,12 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH); if (uctrl != NULL) { - sigset_t oldmask; - - sigemptyset(&mask); - sigaddset(&mask, SIGUSR1); - sigaddset(&mask, SIGALRM); - sigprocmask(SIG_BLOCK, &mask, &oldmask); - if (udev_ctrl_send_settle(uctrl) > 0) - sigsuspend(&oldmask); - sigprocmask(SIG_SETMASK, &oldmask, NULL); + if (udev_ctrl_send_ping(uctrl, timeout) < 0) { + info(udev, "no connection to daemon\n"); + udev_ctrl_unref(uctrl); + rc = 0; + goto out; + } udev_ctrl_unref(uctrl); } } @@ -223,7 +216,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) udev_list_entry_get_value(list_entry)); } } - +out: udev_queue_unref(udev_queue); return rc; } |