diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-14 06:40:06 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-14 06:40:06 +0400 |
commit | 85c414b5e05d2087e779cdd3587d6ad4cae56e72 (patch) | |
tree | 7a7d0acbdfa49ef53a77d09bcf965196bed950e9 | |
parent | 2386d65822c912f0889ac600b1698b0659190133 (diff) |
git-fetch-pack: close output fd after dup'ing the input
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.
-rw-r--r-- | fetch-pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index ec5bad89cd..3475ea380a 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -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"); } |