patches/glibc/2.9/360-2.8-nscd-one-fork.patch
author Titus von Boxberg <titus@v9g.de>
Tue Nov 06 17:02:06 2012 +0100 (2012-11-06)
changeset 3103 a8bf927f6e37
parent 1201 c9967a6e3b25
permissions -rw-r--r--
Makefile.in: Use only standard options compatible with BSD install

Don't use options specific to FSF's coreutils install.

Signed-off-by: Titus von Boxberg <titus@v9g.de>
Message-Id: <51587db99510a9ec08f8.1352226968@tschetwerikow.boxberg.lan>
Patchwork-Id: 197532
     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