process-util: add simple wrapper around PR_SET_CHILD_SUBREAPER
Let's a simple helper that knows how to deal with PID == 1.
This commit is contained in:
+3
-2
@@ -5826,8 +5826,9 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, SIGRTMIN+18, -1) >= 0);
|
||||
|
||||
if (prctl(PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0) < 0) {
|
||||
r = log_error_errno(errno, "Failed to become subreaper: %m");
|
||||
r = make_reaper_process(true);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to become subreaper: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user