diff options
Diffstat (limited to 'src/udev/test-udev-rule-runner.c')
-rw-r--r-- | src/udev/test-udev-rule-runner.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/udev/test-udev-rule-runner.c b/src/udev/test-udev-rule-runner.c index 72296b3..10da645 100644 --- a/src/udev/test-udev-rule-runner.c +++ b/src/udev/test-udev-rule-runner.c @@ -12,6 +12,7 @@ #include <unistd.h> #include "device-private.h" +#include "device-util.h" #include "fs-util.h" #include "log.h" #include "main-func.h" @@ -141,16 +142,15 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_debug_errno(r, "Failed to open device '%s'", devpath); - assert_se(event = udev_event_new(dev, 0, NULL, log_get_max_level())); + assert_se(event = udev_event_new(dev, NULL, EVENT_TEST_RULE_RUNNER)); - assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, SIGHUP, SIGCHLD, -1) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, SIGHUP, SIGCHLD) >= 0); /* do what devtmpfs usually provides us */ if (sd_device_get_devname(dev, &devname) >= 0) { - const char *subsystem; mode_t mode = 0600; - if (sd_device_get_subsystem(dev, &subsystem) >= 0 && streq(subsystem, "block")) + if (device_in_subsystem(dev, "block")) mode |= S_IFBLK; else mode |= S_IFCHR; @@ -169,8 +169,8 @@ static int run(int argc, char *argv[]) { } } - udev_event_execute_rules(event, -1, 3 * USEC_PER_SEC, SIGKILL, NULL, rules); - udev_event_execute_run(event, 3 * USEC_PER_SEC, SIGKILL); + udev_event_execute_rules(event, rules); + udev_event_execute_run(event); return 0; } |