Revert "nscd: don't fork twice"

This reverts commit 7e9b080575.
This commit is contained in:
Andreas Schwab 2013-01-10 10:42:49 +01:00
parent 7490eb81ae
commit ee32fdd79a

View File

@ -252,6 +252,15 @@ main (int argc, char **argv)
for (i = min_close_fd; i < getdtablesize (); i++)
close (i);
if (run_mode == RUN_DAEMONIZE)
{
pid = fork ();
if (pid == -1)
error (EXIT_FAILURE, errno, _("cannot fork"));
if (pid != 0)
exit (0);
}
setsid ();
if (chdir ("/") != 0)