Don't ignore SIGCHLD in createUnixDomainSocket()

This commit is contained in:
Eelco Dolstra 2021-10-05 13:23:16 +02:00
parent e4a5d64a81
commit b14bc06955

View file

@ -156,9 +156,6 @@ static void daemonLoop()
if (chdir("/") == -1) if (chdir("/") == -1)
throw SysError("cannot change current directory"); throw SysError("cannot change current directory");
// Get rid of children automatically; don't let them become zombies.
setSigChldAction(true);
AutoCloseFD fdSocket; AutoCloseFD fdSocket;
// Handle socket-based activation by systemd. // Handle socket-based activation by systemd.
@ -176,6 +173,9 @@ static void daemonLoop()
fdSocket = createUnixDomainSocket(settings.nixDaemonSocketFile, 0666); fdSocket = createUnixDomainSocket(settings.nixDaemonSocketFile, 0666);
} }
// Get rid of children automatically; don't let them become zombies.
setSigChldAction(true);
// Loop accepting connections. // Loop accepting connections.
while (1) { while (1) {