process-util: rework wait_for_terminate_and_warn() to take a flags parameter
This renames wait_for_terminate_and_warn() to wait_for_terminate_and_check(), and adds a flags parameter, that controls how much to log: there's one flag that means we log about abnormal stuff, and another one that controls whether we log about non-zero exit codes. Finally, there's a shortcut flag value for logging in both cases, as that's what we usually use. All callers are accordingly updated. At three occasions duplicate logging is removed, i.e. where the old function was called but logged in the caller, too.
This commit is contained in:
+2
-2
@@ -1554,7 +1554,7 @@ static int socket_address_listen_in_cgroup(
|
||||
fd = receive_one_fd(pair[0], 0);
|
||||
|
||||
/* We synchronously wait for the helper, as it shouldn't be slow */
|
||||
r = wait_for_terminate_and_warn("listen-cgroup-helper", pid, false);
|
||||
r = wait_for_terminate_and_check("listen-cgroup-helper", pid, WAIT_LOG_ABNORMAL);
|
||||
if (r < 0) {
|
||||
safe_close(fd);
|
||||
return r;
|
||||
@@ -2898,7 +2898,7 @@ static int socket_accept_in_cgroup(Socket *s, SocketPort *p, int fd) {
|
||||
cfd = receive_one_fd(pair[0], 0);
|
||||
|
||||
/* We synchronously wait for the helper, as it shouldn't be slow */
|
||||
r = wait_for_terminate_and_warn("accept-cgroup-helper", pid, false);
|
||||
r = wait_for_terminate_and_check("accept-cgroup-helper", pid, WAIT_LOG_ABNORMAL);
|
||||
if (r < 0) {
|
||||
safe_close(cfd);
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user