aboutsummaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorEtienne Buira <etienne.buira@gmail.com>2014-10-18 14:31:15 +0200
committerJunio C Hamano <gitster@pobox.com>2014-10-19 15:38:30 -0700
commit0f4b6db3baeff8de53769b38f439408abd5a42f7 (patch)
treed39a29a7792df19e576e67c8cee9f68d4f54e2ea /builtin/clone.c
parent0c45d258ec35c1ef51523dd45e4518bd8a09258c (diff)
downloadgit-0f4b6db3baeff8de53769b38f439408abd5a42f7.tar.gz
git-0f4b6db3baeff8de53769b38f439408abd5a42f7.tar.xz
Handle atexit list internaly for unthreaded builds
Wrap atexit()s calls on unthreaded builds to handle callback list internally. This is needed because on unthreaded builds, asyncs inherits parent's atexit() list, that gets run as soon as the async exit()s (and again at the end of async's parent process). That led to remove temporary files too early. Also remove a by-atexit-callback guard against this kind of issue in clone.c, as this patch makes it redundant. Fixes test 5537 (temporary shallow file vanished before unpack-objects could open it) BTW remove an unused variable in shallow.c. Helped-by: Duy Nguyen <pclouds@gmail.com> Helped-by: Andreas Schwab <schwab@linux-m68k.org> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Etienne Buira <etienne.buira@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 3927edfb6..434047792 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -390,7 +390,6 @@ static void clone_local(const char *src_repo, const char *dest_repo)
static const char *junk_work_tree;
static const char *junk_git_dir;
-static pid_t junk_pid;
static enum {
JUNK_LEAVE_NONE,
JUNK_LEAVE_REPO,
@@ -417,8 +416,6 @@ static void remove_junk(void)
break;
}
- if (getpid() != junk_pid)
- return;
if (junk_git_dir) {
strbuf_addstr(&sb, junk_git_dir);
remove_dir_recursively(&sb, 0);
@@ -759,8 +756,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
struct refspec *refspec;
const char *fetch_pattern;
- junk_pid = getpid();
-
packet_trace_identity("clone");
argc = parse_options(argc, argv, prefix, builtin_clone_options,
builtin_clone_usage, 0);