diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
commit | 78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch) | |
tree | f515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/udev/test-udev-spawn.c | |
parent | Adding debian version 255.5-1. (diff) | |
download | systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip |
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/udev/test-udev-spawn.c')
-rw-r--r-- | src/udev/test-udev-spawn.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/udev/test-udev-spawn.c b/src/udev/test-udev-spawn.c index 4f43fac..7cbccf3 100644 --- a/src/udev/test-udev-spawn.c +++ b/src/udev/test-udev-spawn.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#include "mountpoint-util.h" #include "path-util.h" #include "signal-util.h" #include "strv.h" @@ -16,8 +17,8 @@ static void test_event_spawn_core(bool with_pidfd, const char *cmd, char *result assert_se(setenv("SYSTEMD_PIDFD", yes_no(with_pidfd), 1) >= 0); assert_se(sd_device_new_from_syspath(&dev, "/sys/class/net/lo") >= 0); - assert_se(event = udev_event_new(dev, 0, NULL, LOG_DEBUG)); - assert_se(udev_event_spawn(event, 5 * USEC_PER_SEC, SIGKILL, false, cmd, result_buf, buf_size, NULL) == 0); + assert_se(event = udev_event_new(dev, NULL, EVENT_TEST_SPAWN)); + assert_se(udev_event_spawn(event, false, cmd, result_buf, buf_size, NULL) == 0); assert_se(unsetenv("SYSTEMD_PIDFD") >= 0); } @@ -80,6 +81,9 @@ static void test2(void) { int main(int argc, char *argv[]) { _cleanup_free_ char *self = NULL; + if (path_is_mount_point("/sys") <= 0) + return log_tests_skipped("/sys is not mounted"); + if (argc > 1) { if (streq(argv[1], "test1")) test1(); @@ -93,7 +97,7 @@ int main(int argc, char *argv[]) { test_setup_logging(LOG_DEBUG); - assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, -1) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD) >= 0); test_event_spawn_cat(true, SIZE_MAX); test_event_spawn_cat(false, SIZE_MAX); |