]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Initialize
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 8 Nov 2005 07:11:58 +0000 (07:11 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 8 Nov 2005 07:11:58 +0000 (07:11 +0000)
`tmp' to avoid file removal race.

ChangeLog
lib/autoconf/status.m4

index 1a8327cddb67a9d8d22f90457f438d7181b15326..21940a2a54f460006c2b74bae583ac00b90ededa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Initialize
+       `tmp' to avoid file removal race.
+
 2005-11-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Initialize
index 88e5ad19f9a8d616e8b1b4d3e4d74db72947c2b3..68fecd1b3c7f13869067f4a32880451cdac71199 100644 (file)
@@ -1317,9 +1317,14 @@ fi
 # simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
 # Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -fr "$tmp" && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap 'AS_EXIT([1])' 1 2 13 15
 }
 dnl The comment above AS_TMPDIR says at most 4 chars are allowed.