summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2013-03-12 17:23:30 -0600
committerEric Blake <eblake@redhat.com>2013-03-15 16:45:29 -0600
commit197bca5d979eab30a82bf42f6c2b856b84e8efb2 (patch)
treea6d710ebdea8f53465b91370d169bd0312a967e7
parent042b801ff69f2fee4993fa785fe62c1b37106b21 (diff)
downloadm4-197bca5d979eab30a82bf42f6c2b856b84e8efb2.tar.gz
build: avoid test failure on HPUX
POSIX permits implementations to open fd 0, 1, and 2 on exec(), even when the user tried to close them. HPUX-11.23 is one of the implementations that does not allow closed standard descriptors, leading to a failure of test 005.command_li. But a test that makes sure we behave gracefully in the face of closed standard descriptors makes no sense on a platform where we can never have them closed, so add some code to skip the test on "helpful" platforms. Note - HPUX opens any closed standard descriptor as O_WRONLY on /dev/null. This means that attempts to close stdout generally result in silent success, but attempts to close stdin often still result in failure when it is not possible to read from the O_WRONLY stdin. * doc/m4.texi (Command line files): Skip tests on systems where it is impossible to start with stdin/out closed. Reported by Gary V. Vaughan. Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--ChangeLog7
-rw-r--r--doc/m4.texi6
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8798406f..1233d2ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-15 Eric Blake <eblake@redhat.com>
+
+ build: avoid test failure on HPUX
+ * doc/m4.texi (Command line files): Skip tests on systems where it
+ is impossible to start with stdin/out closed.
+ Reported by Gary V. Vaughan.
+
2013-03-12 Eric Blake <eblake@redhat.com>
maint: update to latest gnulib
diff --git a/doc/m4.texi b/doc/m4.texi
index b8b1704d..5cca8c4d 100644
--- a/doc/m4.texi
+++ b/doc/m4.texi
@@ -993,6 +993,9 @@ options.
ifdef(`__unix__', ,
`errprint(` skipping: syscmd does not have unix semantics
')m4exit(`77')')dnl
+syscmd(`echo | cat >&- 2>/dev/null')ifelse(sysval, `0',
+ `errprint(` skipping: system does not allow closing stdout
+')m4exit(`77')')dnl
changequote(`[', `]')dnl
syscmd([echo | ']__program__[' >&-])dnl
@error{}m4: write error: Bad file descriptor
@@ -1004,6 +1007,9 @@ sysval
ifdef(`__unix__', ,
`errprint(` skipping: syscmd does not have unix semantics
')m4exit(`77')')dnl
+syscmd(`echo | cat >&- 2>/dev/null')ifelse(sysval, `0',
+ `errprint(` skipping: system does not allow closing stdout
+')m4exit(`77')')dnl
changequote(`[', `]')dnl
syscmd([echo 'esyscmd(echo hi >&2 && echo err"print(bye
)d"nl)dnl' > tmp.m4 \