Bruno Haible <[EMAIL PROTECTED]> writes:
> Eric Blake wrote:
>> http://lists.gnu.org/archive/html/bug-autoconf/2005-11/msg00000.html
>
> It is regrettable that no doc was added to the autoconf manual about
> this pitfall.
Thanks for reminding me about this. I just now installed this patch:
2006-01-25 Paul Eggert <[EMAIL PROTECTED]>
* doc/autoconf.texi (Limitations of Builtins): Document the
problem with "trap -".
--- autoconf.texi.~1.942.~ 2006-01-11 10:17:25.000000000 -0800
+++ autoconf.texi 2006-01-25 14:11:37.000000000 -0800
@@ -11531,6 +11531,13 @@ It is safe to trap at least the signals
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
[EMAIL PROTECTED] '' 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
_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib