mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Simplify if-if-else-if-else in service_start()
Coverity Scan gets very confused and think we are leaking sd in the systemd notify case. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+2
-5
@@ -698,8 +698,7 @@ static int service_start(svc_t *svc)
|
||||
close(fd);
|
||||
result = -1;
|
||||
goto fail;
|
||||
}
|
||||
if (pid > 1) {
|
||||
} else if (pid > 0) {
|
||||
struct sockaddr_un sun;
|
||||
size_t len;
|
||||
|
||||
@@ -734,7 +733,7 @@ static int service_start(svc_t *svc)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (pid == 0) {
|
||||
} else { /* pid == 0 */
|
||||
char str[strlen(NOTIFY_PATH) + 32];
|
||||
char *args[MAX_NUM_SVC_ARGS + 1];
|
||||
int status;
|
||||
@@ -885,8 +884,6 @@ static int service_start(svc_t *svc)
|
||||
syslog(LOG_ERR, "failed starting %s, exit code %d: %s", svc_ident(svc, NULL, 0),
|
||||
status, strerror(errno));
|
||||
_exit(status);
|
||||
} else if (debug) {
|
||||
dbg("Starting PID %d: %s", svc->pid, cmdline);
|
||||
}
|
||||
|
||||
if (!svc_is_sysv(svc))
|
||||
|
||||
Reference in New Issue
Block a user