]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Builtins): Document the
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Jan 2006 22:14:16 +0000 (22:14 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Jan 2006 22:14:16 +0000 (22:14 +0000)
problem with "trap -".

ChangeLog
doc/autoconf.texi

index 6b24f22a6a0f5e094af2505693e57dfeae8addd8..77ceb5939239fc781495aa5657d2ba75dfb6b90a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc/autoconf.texi (Limitations of Builtins): Document the
+       problem with "trap -".
+
 2006-01-23  Steven G. Johnson  <stevenj@fftw.org>
 
        * lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS, _AC_FC_DUMMY_MAIN):
index a0ebceba53a36411bb74217d85935fa4bdcd0b30..8396b06da45cdbe23a15de87afe074d7ce5bd558 100644 (file)
@@ -11531,6 +11531,13 @@ It is safe to trap at least the signals 1, 2, 13, and 15.  You can also
 trap 0, i.e., have the @command{trap} run when the script ends (either via an
 explicit @command{exit}, or the end of the script).
 
+Posix says that @samp{trap - 1 2 13 15} resets the traps for the
+specified signals to their default values, but many common shells (e.g.,
+Solaris @command{/bin/sh}) misinterpret this and attempt to execute a
+``command'' named @command{-} when the specified conditions arise.
+There is no portable workaround, except for @samp{trap - 0}, for which
+@samp{trap '' 0} is a portable substitute.
+
 Although Posix is not absolutely clear on this point, it is widely
 admitted that when entering the trap @samp{$?} should be set to the exit
 status of the last command run before the trap.  The ambiguity can be