Handle atexit list internaly for unthreaded builds
commit0f4b6db3baeff8de53769b38f439408abd5a42f7
authorEtienne Buira <etienne.buira@gmail.com>
Sat, 18 Oct 2014 12:31:15 +0000 (18 14:31 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 19 Oct 2014 22:38:30 +0000 (19 15:38 -0700)
treed39a29a7792df19e576e67c8cee9f68d4f54e2ea
parent0c45d258ec35c1ef51523dd45e4518bd8a09258c
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>
builtin/clone.c
git-compat-util.h
run-command.c
shallow.c