From ff2c503df091e6e4e9ab48cdb6df6ec8b7b525d0 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 13 Apr 2011 01:17:09 +0200 Subject: udevadm: control - add --exit --- udev/udevadm-settle.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'udev/udevadm-settle.c') 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; } -- cgit v1.2.3-54-g00ecf