Skip to content

Commit

Permalink
git-fetch-pack: close output fd after dup'ing the input
Browse files Browse the repository at this point in the history
With the socket case, the input and output fd's might end up being the same,
so we want to dup the other before we close either of them.
  • Loading branch information
Linus Torvalds committed Jul 14, 2005
1 parent 2386d65 commit 85c414b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ static int fetch_pack(int fd[2], int nr_match, char **match)
if (pid < 0)
die("git-fetch-pack: unable to fork off git-unpack-objects");
if (!pid) {
close(fd[1]);
dup2(fd[0], 0);
close(fd[0]);
close(fd[1]);
execlp("git-unpack-objects", "git-unpack-objects", NULL);
die("git-unpack-objects exec failed");
}
Expand Down

0 comments on commit 85c414b

Please sign in to comment.