Fix minor descriptor leak, found by Coverity Scan

It is safe to always close() the fd here.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2020-01-03 09:46:11 +01:00
parent f06ab73e13
commit 39ea566d45

View File

@ -2036,8 +2036,7 @@ static int waitdaemon(int maxwait)
(void)dup2(fd, STDIN_FILENO);
(void)dup2(fd, STDOUT_FILENO);
(void)dup2(fd, STDERR_FILENO);
if (fd > STDERR_FILENO)
(void)close(fd);
(void)close(fd);
}
return getppid();