From: Linus Torvalds Date: Thu, 14 Jul 2005 03:05:17 +0000 (-0700) Subject: Fix the "close before dup" bug in clone-pack too X-Git-Tag: v0.99.1~38 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5ccdf4cef212183597a0893c23c91da2ded80694;p=git.git Fix the "close before dup" bug in clone-pack too Same issue as git-fetch-pack. --- diff --git a/clone-pack.c b/clone-pack.c index 8f5209cfd..252fb80ef 100644 --- a/clone-pack.c +++ b/clone-pack.c @@ -152,9 +152,9 @@ static int clone_pack(int fd[2], int nr_match, char **match) if (pid < 0) die("git-clone-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", quiet ? "-q" : NULL, NULL); die("git-unpack-objects exec failed");