]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: ignore return value of unit_watch_pid() 23626/head
authorShreenidhi Shedi <sshedi@vmware.com>
Sat, 4 Jun 2022 10:33:30 +0000 (16:03 +0530)
committerShreenidhi Shedi <sshedi@vmware.com>
Sun, 5 Jun 2022 17:28:01 +0000 (22:58 +0530)
Also, explicitly ignore return value of service_set_main_pid() calls in
few places.

Fixes: CID#1474975
src/core/service.c

index 9f7af9dffb5f1d07aa8e0e60d994e272213d0d8f..5f1a218bb5beba1a679f0d2340b7343ee0cfb6b1 100644 (file)
@@ -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;
 }