summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2386d65)
raw | patch | inline | side by side (parent: 2386d65)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Thu, 14 Jul 2005 02:40:06 +0000 (19:40 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Thu, 14 Jul 2005 02:40:06 +0000 (19:40 -0700) |
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.
so we want to dup the other before we close either of them.
fetch-pack.c | patch | blob | history |
diff --git a/fetch-pack.c b/fetch-pack.c
index ec5bad89cdb3f6eae038877856f2eefb1125bf6f..3475ea380a29495269ac64fa9e4ff797b9b8687c 100644 (file)
--- a/fetch-pack.c
+++ b/fetch-pack.c
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");
}