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:
Joachim Nilsson
2015-02-26 16:39:30 +01:00
parent 216701ce3c
commit fc9758da8e
+5 -2
View File
@@ -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? */
if (SVC_CMD_INETD == svc->type) {
if (svc->inetd.type == SOCK_STREAM)
close(sd);
if (svc->inetd.type == SOCK_STREAM) {
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
}
}
exit(status);