From: Shreenidhi Shedi Date: Sat, 4 Jun 2022 10:33:30 +0000 (+0530) Subject: manager: ignore return value of unit_watch_pid() X-Git-Tag: v252-rc1~867^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F23626%2Fhead;p=thirdparty%2Fsystemd.git manager: ignore return value of unit_watch_pid() Also, explicitly ignore return value of service_set_main_pid() calls in few places. Fixes: CID#1474975 --- diff --git a/src/core/service.c b/src/core/service.c index 9f7af9dffb5..5f1a218bb5b 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -2235,7 +2235,7 @@ static void service_enter_start(Service *s) { /* For simple services we immediately start * the START_POST binaries. */ - service_set_main_pid(s, pid); + (void) service_set_main_pid(s, pid); service_enter_start_post(s); } else if (s->type == SERVICE_FORKING) { @@ -2253,7 +2253,7 @@ static void service_enter_start(Service *s) { /* For D-Bus services we know the main pid right away, but wait for the bus name to appear on the * bus. 'notify' and 'exec' services are similar. */ - service_set_main_pid(s, pid); + (void) service_set_main_pid(s, pid); service_set_state(s, SERVICE_START); } else assert_not_reached(); @@ -2496,7 +2496,7 @@ static void service_run_next_main(Service *s) { if (r < 0) goto fail; - service_set_main_pid(s, pid); + (void) service_set_main_pid(s, pid); return; @@ -4123,7 +4123,7 @@ static void service_notify_message( log_unit_debug(u, "New main PID "PID_FMT" does not belong to service, refusing.", new_main_pid); } if (r > 0) { - service_set_main_pid(s, new_main_pid); + (void) service_set_main_pid(s, new_main_pid); r = unit_watch_pid(UNIT(s), new_main_pid, false); if (r < 0) @@ -4339,8 +4339,8 @@ static int bus_name_pid_lookup_callback(sd_bus_message *reply, void *userdata, s log_unit_debug(u, "D-Bus name %s is now owned by process " PID_FMT, s->bus_name, (pid_t) pid); - service_set_main_pid(s, pid); - unit_watch_pid(UNIT(s), pid, false); + (void) service_set_main_pid(s, pid); + (void) unit_watch_pid(UNIT(s), pid, false); return 1; }