summaryrefslogtreecommitdiffstats
path: root/watchquagga
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-07 20:13:49 +0200
committerPaul Jakma <paul@quagga.net>2009-08-13 11:21:13 +0200
commit065de90380c88d9fcc116627f714bed9984c2723 (patch)
tree79061a2699e0dc3e87c218b3b57c2f0577d5a69a /watchquagga
parentbgp: missing pieces from listener patch (diff)
downloadfrr-065de90380c88d9fcc116627f714bed9984c2723.tar.xz
frr-065de90380c88d9fcc116627f714bed9984c2723.zip
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 'watchquagga')
-rw-r--r--watchquagga/watchquagga.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c
index f4c483cf4..fb628acca 100644
--- a/watchquagga/watchquagga.c
+++ b/watchquagga/watchquagga.c
@@ -1343,7 +1343,11 @@ main(int argc, char **argv)
if (daemon_mode)
{
zlog_set_level(NULL, ZLOG_DEST_SYSLOG, MIN(gs.loglevel,LOG_DEBUG));
- daemon(0, 0);
+ if (daemon (0, 0) < 0)
+ {
+ fprintf(stderr, "Watchquagga daemon failed: %s", strerror(errno));
+ exit (1);
+ }
}
else
zlog_set_level(NULL, ZLOG_DEST_STDOUT, MIN(gs.loglevel,LOG_DEBUG));