Merge pull request #26447 from poettering/sigqueue

pid1/systemctl: add ability to enqueue POSIX RT sigs with associated value to service processes
This commit is contained in:
Lennart Poettering
2023-02-17 10:51:58 +01:00
committed by GitHub
26 changed files with 442 additions and 130 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ static void wait_for_service_finish(Manager *m, Unit *unit) {
n = now(CLOCK_MONOTONIC);
if (ts + timeout < n) {
log_error("Test timeout when testing %s", unit->id);
r = unit_kill(unit, KILL_ALL, SIGKILL, NULL);
r = unit_kill(unit, KILL_ALL, SIGKILL, SI_USER, 0, NULL);
if (r < 0)
log_error_errno(r, "Failed to kill %s: %m", unit->id);
exit(EXIT_FAILURE);
+40
View File
@@ -954,4 +954,44 @@ TEST(strv_extend_join) {
assert_se(streq(v[1], "ABC=QER"));
}
TEST(strv_copy_n) {
char **x = STRV_MAKE("a", "b", "c", "d", "e");
_cleanup_strv_free_ char **l = NULL;
l = strv_copy_n(x, 0);
assert_se(strv_equal(l, NULL));
strv_free(l);
l = strv_copy_n(x, 0);
assert_se(strv_equal(l, (char**) { NULL }));
strv_free(l);
l = strv_copy_n(x, 1);
assert_se(strv_equal(l, STRV_MAKE("a")));
strv_free(l);
l = strv_copy_n(x, 2);
assert_se(strv_equal(l, STRV_MAKE("a", "b")));
strv_free(l);
l = strv_copy_n(x, 3);
assert_se(strv_equal(l, STRV_MAKE("a", "b", "c")));
strv_free(l);
l = strv_copy_n(x, 4);
assert_se(strv_equal(l, STRV_MAKE("a", "b", "c", "d")));
strv_free(l);
l = strv_copy_n(x, 5);
assert_se(strv_equal(l, STRV_MAKE("a", "b", "c", "d", "e")));
strv_free(l);
l = strv_copy_n(x, 6);
assert_se(strv_equal(l, STRV_MAKE("a", "b", "c", "d", "e")));
strv_free(l);
l = strv_copy_n(x, SIZE_MAX);
assert_se(strv_equal(l, STRV_MAKE("a", "b", "c", "d", "e")));
}
DEFINE_TEST_MAIN(LOG_INFO);