[quagga-dev,15437] isisd: exit if daemonizing fails

Message ID 1465240395-27299-1-git-send-email-chris@opensourcerouting.org
State Under Review
Headers show

Commit Message

Christian Franke June 6, 2016, 7:13 p.m.
From: Christian Franke <nobody@nowhere.ws>

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>
---
 isisd/isis_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

cisystem@netdef.org June 6, 2016, 8:40 p.m. | #1
Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF CI System <cisystem@netdef.org>

This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1956: http://patchwork.quagga.net/patch/1956
       [quagga-dev,15437] isisd: exit if daemonizing fails
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-297/


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Donald Sharp June 7, 2016, 1:34 a.m. | #2
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>

On Mon, Jun 6, 2016 at 3:13 PM, Christian Franke <
chris@opensourcerouting.org> wrote:

> From: Christian Franke <nobody@nowhere.ws>
>
> 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>
> ---
>  isisd/isis_main.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/isisd/isis_main.c b/isisd/isis_main.c
> index 3a73087..02ea0d7 100644
> --- a/isisd/isis_main.c
> +++ b/isisd/isis_main.c
> @@ -355,8 +355,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')
> --
> 2.8.0
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>

Patch hide | download patch | download mbox

diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 3a73087..02ea0d7 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -355,8 +355,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')