From efeb864cb547a2cbf96dc0053a8bdb4d9190b364 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:45 +0200 Subject: Merging upstream version 256. Signed-off-by: Daniel Baumann --- src/udev/test-udev-rule-runner.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/udev/test-udev-rule-runner.c') 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 #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; } -- cgit v1.2.3