diff options
author | paco <paco@voltanet.io> | 2018-06-13 18:07:36 +0200 |
---|---|---|
committer | paco <paco@voltanet.io> | 2018-06-13 18:07:36 +0200 |
commit | 657f9948ed593387d29d391832c18dc04326a5a9 (patch) | |
tree | da4bbe057dd4357fb34402ac466dfe8c44284876 /tools/start-stop-daemon.c | |
parent | Merge pull request #2421 from pacovn/Coverity_1399232_Logically_dead_code (diff) | |
download | frr-657f9948ed593387d29d391832c18dc04326a5a9.tar.xz frr-657f9948ed593387d29d391832c18dc04326a5a9.zip |
tools: return check (Coverity 1143220)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to 'tools/start-stop-daemon.c')
-rw-r--r-- | tools/start-stop-daemon.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c index 6bf55b774..4758d2066 100644 --- a/tools/start-stop-daemon.c +++ b/tools/start-stop-daemon.c @@ -1030,8 +1030,10 @@ int main(int argc, char **argv) umask(022); /* set a default for dumb programs */ setpgid(0, 0); /* set the process group */ fd = open("/dev/null", O_RDWR); /* stdin */ - dup(fd); /* stdout */ - dup(fd); /* stderr */ + if (fd >= 0) { + dup(fd); /* stdout */ + dup(fd); /* stderr */ + } } if (nicelevel) { errno = 0; |