Re: fix several regressions

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 7/20/2009 7:11 AM:
> Over the weekend, I identified several regressions introduced into m4
> 1.4.13 due to increased use of gnulib.  Many of these are corner cases
> (and one appears to affect only cygwin 1.7), but they are all worth fixing
> (and most of the fixes were made to gnulib over the weekend); I will
> probably spin m4 1.4.14 in mid-August (I will be going on vacation next
> week, and don't think I'll have time for the release this week).  All
> three branches will need these fixes.

And testing on other platforms (in this case, Solaris) shows that there
were still issues:

Checking ../../checks/005.command_li
@ ../doc/m4.texinfo:966: Origin of test
../../checks/005.command_li: stderr mismatch
- --- m4-tmp.23252/m4-xerr        2009-07-21 22:02:34.222251040 -0600
+++ m4-tmp.23252/m4-err 2009-07-21 22:02:34.103613400 -0600
@@ -1,2 +1,2 @@
- -m4: write error: Bad file descriptor
+m4: write error: Bad file number
 hi
Checking ../../checks/192.sysval
@ ../doc/m4.texinfo:6617: Origin of test
../../checks/192.sysval: stderr mismatch
- --- m4-tmp.23252/m4-xerr        2009-07-21 22:02:34.451926640 -0600
+++ m4-tmp.23252/m4-err 2009-07-21 22:02:34.358491080 -0600
@@ -0,0 +1 @@
+m4:stdin:10: cannot run command `echo dnl && exit 127': Illegal seek
Checking ../../checks/193.sysval


Fixed as follows:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpmj6oACgkQ84KuGfSFAYDolgCeNYTfrol87I2ntVAQ4wkrz0yP
GpYAoIK16Q0clFn/paPQXvaz9Cq6JXNs
=0Nl9
-----END PGP SIGNATURE-----

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch429 (text/plain, 2.2 KB)
From 3d14a9bdc82534da8e2bed18125a612344a6a9c9 Mon Sep 17 00:00:00 2001
From: Eric Blake <[email protected]>
Date: Tue, 21 Jul 2009 21:38:41 -0600
Subject: [PATCH] Fix testsuite on Solaris.

* doc/m4.texinfo (Command line files): Tolerate different spelling
of EBADF.
* src/builtin.c (m4_esyscmd): Clear errno before reaping.

Signed-off-by: Eric Blake <[email protected]>
---
 ChangeLog      |    7 +++++++
 doc/m4.texinfo |   11 ++++++++++-
 src/builtin.c  |    1 +
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a2d5c51..ceca154 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-22  Eric Blake  <[email protected]>
+
+	Fix testsuite on Solaris.
+	* doc/m4.texinfo (Command line files): Tolerate different spelling
+	of EBADF.
+	* src/builtin.c (m4_esyscmd): Clear errno before reaping.
+
 2009-07-21  Eric Blake  <[email protected]>

 	Fix testsuite on mingw.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 9195e06..b95d109 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -961,8 +961,10 @@ Command line files
 @error{}m4: cannot open `Makefile/': Not a directory
 @end example

-@comment Test that closed stderr does not cause a crash.
+@comment Test that closed stderr does not cause a crash.  Not all
+@comment systems have the same message for EBADF.

+@comment xerr: ignore
 @example
 ifdef(`__unix__', ,
       `errprint(` skipping: syscmd does not have unix semantics
@@ -972,6 +974,13 @@ Command line files
 @error{}m4: write error: Bad file descriptor
 sysval
 @result{}1
+@end example
+
+@example
+ifdef(`__unix__', ,
+      `errprint(` skipping: syscmd does not have unix semantics
+')m4exit(`77')')dnl
+changequote(`[', `]')dnl
 syscmd([echo 'esyscmd(echo hi >&2)dnl' > tmp.m4 \
   && ']__program__[' tmp.m4 <&- >&- \
   && rm tmp.m4])sysval
diff --git a/src/builtin.c b/src/builtin.c
index d416a00..5a097f3 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1042,6 +1042,7 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
     }
   if (ferror (pin) || fclose (pin))
     M4ERROR ((EXIT_FAILURE, errno, "cannot read pipe"));
+  errno = 0;
   status = wait_subprocess (child, ARG (0), false, true, true, false,
 			    &sig_status);
   if (sig_status)
-- 
1.6.3.3.334.g916e1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.