patches/glibc/2.9/360-2.8-nscd-one-fork.patch
author danielrubiob@gmail.com
Tue Feb 11 21:34:48 2014 +0100 (2014-02-11)
changeset 3285 a8cb9039fade
parent 1201 c9967a6e3b25
permissions -rw-r--r--
complibs/cloog: bump version

Signed-off-by: Daniel Rubio Bonilla <danielrubiob@gmail.com>
[yann.morin.1998@free.fr: re-order versions]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Cody P Schafer <dev@codyps.com>
Message-Id: <c2de3964cd6d5e4173cc.1391984023@uemo>
Patchwork-Id: 318637
     1 Original patch from: gentoo/src/patchsets/glibc/2.9/1160_all_glibc-2.8-nscd-one-fork.patch
     2 
     3 -= BEGIN original header =-
     4 only fork one to assist in stop-start-daemon assumptions about daemon behavior
     5 
     6 http://bugs.gentoo.org/190785
     7 
     8 -= END original header =-
     9 
    10 diff -durN glibc-2_9.orig/nscd/nscd.c glibc-2_9/nscd/nscd.c
    11 --- glibc-2_9.orig/nscd/nscd.c	2008-03-29 19:08:12.000000000 +0100
    12 +++ glibc-2_9/nscd/nscd.c	2009-02-02 22:01:10.000000000 +0100
    13 @@ -179,6 +179,9 @@
    14        if (pid != 0)
    15  	exit (0);
    16  
    17 +       if (write_pid (_PATH_NSCDPID) < 0)
    18 +	dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
    19 +
    20        int nullfd = open (_PATH_DEVNULL, O_RDWR);
    21        if (nullfd != -1)
    22  	{
    23 @@ -228,12 +231,6 @@
    24  	for (i = min_close_fd; i < getdtablesize (); i++)
    25  	  close (i);
    26  
    27 -      pid = fork ();
    28 -      if (pid == -1)
    29 -	error (EXIT_FAILURE, errno, _("cannot fork"));
    30 -      if (pid != 0)
    31 -	exit (0);
    32 -
    33        setsid ();
    34  
    35        if (chdir ("/") != 0)
    36 @@ -242,9 +239,6 @@
    37  
    38        openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
    39  
    40 -      if (write_pid (_PATH_NSCDPID) < 0)
    41 -        dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
    42 -
    43        if (!init_logfile ())
    44  	dbg_log (_("Could not create log file"));
    45