Skip to content

Commit

Permalink
nix-0.12: add AutoCloseFD::get() to access files descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
jpierre03 committed Jan 31, 2017
1 parent b4b05ab commit 02be6bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fetchgit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ extern "C" void fetchgit( nix::EvalState & state
throw SysError("forking to run fetchgit");
case 0:
pipe.readSide = -1;
if (dup2(pipe.writeSide, STDOUT_FILENO) == -1)
if (dup2(pipe.writeSide.get(), STDOUT_FILENO) == -1)
err(214, "duping pipe to stdout");
/* const-correct, execv doesn't modify it c just has dumb casting rules */
execv(fetchgit_path, const_cast<char * const *>(argv));
err(212, "executing %s", fetchgit_path);
}
pipe.writeSide = -1;
auto path = nix::drainFD(pipe.readSide);
auto path = nix::drainFD(pipe.readSide.get());

int status;
errno = 0;
Expand Down

0 comments on commit 02be6bc

Please sign in to comment.