mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-12 10:00:46 +02:00
daemon: Close the read end of the logging pipe.
* nix/libutil/util.cc (commonChildInit): Close ‘logPipe.readSide’. Reported-by: Reepca Russelstein <reepca@russelstein.xyz> Change-Id: Ia9e48d1afb85d7af52770e016f2b6832792044dd
This commit is contained in:
parent
f03e6eff2f
commit
7bad04fac0
1 changed files with 3 additions and 0 deletions
|
@ -1279,6 +1279,9 @@ void commonChildInit(Pipe & logPipe)
|
|||
if (setsid() == -1)
|
||||
throw SysError(format("creating a new session"));
|
||||
|
||||
/* Close the read end so only the parent holds a reference to it. */
|
||||
logPipe.readSide.close();
|
||||
|
||||
/* Dup the write side of the logger pipe into stderr. */
|
||||
if (dup2(logPipe.writeSide, STDERR_FILENO) == -1)
|
||||
throw SysError("cannot pipe standard error into log file");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue