mirror of
https://github.com/troglobit/finit.git
synced 2026-11-02 13:20:32 +00:00
Fix Coverity CID #87811 Double close
Fix double close of TCP socket introduced in GIT ded4b39,
replaced with closing all open stdio descriptors, which
shouldn't really be needed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
216701ce3c
commit
fc9758da8e
1 file changed
+5
-2
@@ -677,8 +677,11 @@ int svc_start(svc_t *svc)
|
|||||||
status = execv(svc->cmd, args); /* XXX: Maybe use execve() to be able to launch scripts? */
|
status = execv(svc->cmd, args); /* XXX: Maybe use execve() to be able to launch scripts? */
|
||||||
|
|
||||||
if (SVC_CMD_INETD == svc->type) {
|
if (SVC_CMD_INETD == svc->type) {
|
||||||
if (svc->inetd.type == SOCK_STREAM)
|
if (svc->inetd.type == SOCK_STREAM) {
|
||||||
close(sd);
|
close(STDIN_FILENO);
|
||||||
|
close(STDOUT_FILENO);
|
||||||
|
close(STDERR_FILENO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(status);
|
exit(status);
|
||||||
|
|||||||
Reference in new issue
Block a user