diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-08-07 11:13:49 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-08-13 10:21:13 +0100 |
commit | 065de90380c88d9fcc116627f714bed9984c2723 (patch) | |
tree | 79061a2699e0dc3e87c218b3b57c2f0577d5a69a /ospfd | |
parent | 5bd5881838c22e075c3d0c245a8952a55e9dca38 (diff) |
all: check return value from daemon() call
* */*main.c: (main) Current versions of Gcc warn if the return value for
daemon() is not checked. So add a simple test and exit on failure.
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 2dd997e8..8b9a3458 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -314,8 +314,11 @@ main (int argc, char **argv) return(0); /* Change to the daemon program. */ - if (daemon_mode) - daemon (0, 0); + if (daemon_mode && daemon (0, 0) < 0) + { + zlog_err("OSPFd daemon failed: %s", strerror(errno)); + exit (1); + } /* Process id file create. */ pid_output (pid_file); |