core/service: declare 'int r' at the beginning

This commit is contained in:
Yu Watanabe
2024-01-24 14:43:18 +09:00
parent ae6a9e650c
commit c917a80701
+1 -3
View 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);