1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 00:07:58 +02:00

build-remote: Ugly hackery to get build logs to work

The build hook mechanism expects build log output to go to file
descriptor 4, so do that.
This commit is contained in:
Eelco Dolstra 2017-05-02 12:01:46 +02:00
parent 3a5f04f48c
commit feefcb3a98
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 11 additions and 3 deletions

View file

@ -31,6 +31,8 @@ std::unique_ptr<SSHMaster::Connection> SSHMaster::startCommand(const std::string
throw SysError("duping over stdin");
if (dup2(out.writeSide.get(), STDOUT_FILENO) == -1)
throw SysError("duping over stdout");
if (logFD != -1 && dup2(logFD, STDERR_FILENO) == -1)
throw SysError("duping over stderr");
Strings args = { "ssh", host.c_str(), "-x", "-a" };
addCommonSSHOpts(args);