Skip to content

Commit

Permalink
Merge branch 'pr-nix-0.12' of git://github.com/jpierre03/nix-exec
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Jan 31, 2017
2 parents 11fa580 + 02be6bc commit 860d6ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fetchgit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extern "C" void fetchgit( nix::EvalState & state
auto submodules_iter = args[0]->attrs->find(submodules_sym);
auto do_submodules = submodules_iter == args[0]->attrs->end() ?
true :
state.forceBool(*submodules_iter->value);
state.forceBool(*submodules_iter->value, *submodules_iter->pos);

constexpr char fetchgit_path[] = NIXEXEC_LIBEXEC_DIR "/fetchgit.sh";
const char * const argv[] = { fetchgit_path
Expand All @@ -96,15 +96,15 @@ extern "C" void fetchgit( nix::EvalState & state
case -1:
throw SysError("forking to run fetchgit");
case 0:
pipe.readSide.close();
if (dup2(pipe.writeSide, STDOUT_FILENO) == -1)
pipe.readSide = -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.close();
auto path = nix::drainFD(pipe.readSide);
pipe.writeSide = -1;
auto path = nix::drainFD(pipe.readSide.get());

int status;
errno = 0;
Expand Down

0 comments on commit 860d6ef

Please sign in to comment.