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.
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 2dd997e..8b9a345 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -314,8 +314,11 @@
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);