1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00

Merge pull request #8049 from edolstra/unexpected-eof

Fix "unexpected EOF" errors on macOS
This commit is contained in:
Eelco Dolstra 2023-03-16 16:13:42 +01:00 committed by GitHub
commit 7f46ebcf90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 64 deletions

View file

@ -1968,7 +1968,7 @@ std::string showBytes(uint64_t bytes)
// FIXME: move to libstore/build
void commonChildInit(Pipe & logPipe)
void commonChildInit(int stderrFd)
{
logger = makeSimpleLogger();
@ -1983,7 +1983,7 @@ void commonChildInit(Pipe & logPipe)
throw SysError("creating a new session");
/* Dup the write side of the logger pipe into stderr. */
if (dup2(logPipe.writeSide.get(), STDERR_FILENO) == -1)
if (dup2(stderrFd, STDERR_FILENO) == -1)
throw SysError("cannot pipe standard error into log file");
/* Dup stderr to stdout. */

View file

@ -704,7 +704,7 @@ typedef std::function<bool(const Path & path)> PathFilter;
extern PathFilter defaultPathFilter;
/* Common initialisation performed in child processes. */
void commonChildInit(Pipe & logPipe);
void commonChildInit(int stderrFd);
/* Create a Unix domain socket. */
AutoCloseFD createUnixDomainSocket();