Browse Source

isisd: exit if daemonizing fails

The other daemons in Quagga exit with an error if they cannot fork.
Change isisd to behave consistently.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Christian Franke 3 years ago
parent
commit
5a7a23b09f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      isisd/isis_main.c

+ 5 - 2
isisd/isis_main.c

@@ -358,8 +358,11 @@ main (int argc, char **argv, char **envp)
     return(0);
   
   /* demonize */
-  if (daemon_mode)
-    daemon (0, 0);
+  if (daemon_mode && daemon (0, 0) < 0)
+    {
+      zlog_err("IS-IS daemon failed: %s", strerror(errno));
+      exit (1);
+    }
 
   /* Process ID file creation. */
   if (pid_file[0] != '\0')