summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-08-17 11:58:32 -0600
committerEric Blake <ebb9@byu.net>2009-08-24 19:43:04 -0600
commitdb2b33bf92064729e8efde7f3342c3ee8014032d (patch)
tree4863940ec3e2ab520bed822731746eb177c1ecbe
parent724c9cba4f9e8f7925d93f5aaa9899de8fa37f30 (diff)
downloadm4-db2b33bf92064729e8efde7f3342c3ee8014032d.tar.gz
A status of 127 does not always imply esyscmd failure.
* modules/gnu.c (esyscmd): Silence gnulib message; regression introduced 2009-03-13. * doc/m4.texinfo (Sysval): Test this. * NEWS: Document the change. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit 5fa9c079fbe226113280ac86401b432d9c0e7981)
-rw-r--r--ChangeLog8
-rw-r--r--NEWS8
-rw-r--r--doc/m4.texinfo6
-rw-r--r--modules/gnu.c3
4 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 70f7bccb..df680192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-08-24 Eric Blake <ebb9@byu.net>
+
+ A status of 127 does not always imply esyscmd failure.
+ * modules/gnu.c (esyscmd): Silence gnulib message; regression
+ introduced 2009-03-13.
+ * doc/m4.texinfo (Sysval): Test this.
+ * NEWS: Document the change.
+
2009-06-26 Eric Blake <ebb9@byu.net>
Use bitrotate for hashing.
diff --git a/NEWS b/NEWS
index c14107f8..0c669fd8 100644
--- a/NEWS
+++ b/NEWS
@@ -335,6 +335,14 @@ contains the following beta features that were deemed worth deferring until
** A number of portability improvements inherited from gnulib.
+* Noteworthy changes in Version 1.4.14 (2009-??-??) [stable]
+ Released by Eric Blake, based on git version 1.4.13.*
+
+** Fix regression introduced in 1.4.13 in the `esyscmd' builtin, where
+ a child status of 127 made m4 print a spurious message to stderr.
+
+** A number of portability improvements inherited from gnulib.
+
* Noteworthy changes in Version 1.4.13 (2009-04-01) [stable]
Released by Eric Blake, based on git version 1.4.12.*
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 2a31238b..71c84218 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -8210,10 +8210,10 @@ esyscmd(`false')
@result{}
ifelse(sysval, `0', `zero', `non-zero')
@result{}non-zero
-esyscmd(`exit 2')
+esyscmd(`echo dnl && exit 127')
@result{}
sysval
-@result{}2
+@result{}127
esyscmd(`true')
@result{}
sysval
@@ -8224,7 +8224,7 @@ sysval
command, for example, if the system-imposed argument length is exceeded,
or if there were not enough resources to fork. It is not possible to
distinguish between failed execution and successful execution that had
-an exit status of 127.
+an exit status of 127, unless there was output from the child process.
On UNIX platforms, where it is possible to detect when command execution
is terminated by a signal, rather than a normal exit, the result is the
diff --git a/modules/gnu.c b/modules/gnu.c
index 5650c727..665b57cb 100644
--- a/modules/gnu.c
+++ b/modules/gnu.c
@@ -731,7 +731,8 @@ M4BUILTIN_HANDLER (esyscmd)
m4_error (context, EXIT_FAILURE, errno, me,
_("cannot read pipe to command %s"),
quotearg_style (locale_quoting_style, cmd));
- status = wait_subprocess (child, caller, false, false, true, false,
+ errno = 0;
+ status = wait_subprocess (child, caller, false, true, true, false,
&sig_status);
if (sig_status)
{