]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: declare 'int r' at the beginning
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 24 Jan 2024 05:39:20 +0000 (14:39 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 24 Jan 2024 05:43:18 +0000 (14:43 +0900)
src/core/service.c

index 97b547084eebc982e302410042213009a6ea98f3..5ebaddf18822ddf0cfa72f8691d8edb69ff99035 100644 (file)
@@ -3701,6 +3701,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         Service *s = SERVICE(u);
         ServiceResult f;
         ExitClean clean_mode;
+        int r;
 
         assert(s);
         assert(pid >= 0);
@@ -3952,7 +3953,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
 
                                 if (s->pid_file) {
                                         bool has_start_post;
-                                        int r;
 
                                         /* Let's try to load the pid file here if we can.
                                          * The PID file might actually be created by a START_POST
@@ -3979,8 +3979,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                                 }
 
                                 if (s->pid_file) {
-                                        int r;
-
                                         r = service_load_pid_file(s, true);
                                         if (r < 0) {
                                                 r = service_demand_pid_file(s);