process-util: change pid_is_alive() to not eat up errors, and add pidref_is_alive()

Let's no eat up errors, but propagate unexpected ones.
This commit is contained in:
Lennart Poettering
2023-10-18 14:40:25 +02:00
parent 8b51341545
commit becdfcb9f1
6 changed files with 52 additions and 26 deletions
+4 -4
View File
@@ -224,11 +224,11 @@ TEST(pid_is_alive) {
} else {
int status;
waitpid(pid, &status, 0);
assert_se(!pid_is_alive(pid));
assert_se(waitpid(pid, &status, 0) == pid);
assert_se(pid_is_alive(pid) == 0);
}
assert_se(pid_is_alive(getpid_cached()));
assert_se(!pid_is_alive(-1));
assert_se(pid_is_alive(getpid_cached()) > 0);
assert_se(pid_is_alive(-1) < 0);
}
TEST(personality) {