POSIX permits implementations to open fd 0, 1, and 2 on exec(), even when the user tried to close them. HPUX-11.21 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.
* 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 <ebl...@redhat.com> --- Gary, I think this will fix the issue you saw, but would like some confirmation before I push it. ChangeLog | 5 +++++ doc/m4.texi | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8798406..191a849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2013-03-12 Eric Blake <ebl...@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. + maint: update to latest gnulib * gnulib: Update to latest, for mingw compile fixes. diff --git a/doc/m4.texi b/doc/m4.texi index b8b1704..5d9bd6f 100644 --- a/doc/m4.texi +++ b/doc/m4.texi @@ -993,6 +993,9 @@ Command line files ifdef(`__unix__', , `errprint(` skipping: syscmd does not have unix semantics ')m4exit(`77')')dnl +syscmd(`cat <&- 2>/dev/null')ifelse(sysval, `0', + `errprint(` skipping: system does not allow closing stdin +')m4exit(`77')')dnl changequote(`[', `]')dnl syscmd([echo | ']__program__[' >&-])dnl @error{}m4: write error: Bad file descriptor @@ -1004,6 +1007,9 @@ Command line files ifdef(`__unix__', , `errprint(` skipping: syscmd does not have unix semantics ')m4exit(`77')')dnl +syscmd(`cat <&- 2>/dev/null')ifelse(sysval, `0', + `errprint(` skipping: system does not allow closing stdin +')m4exit(`77')')dnl changequote(`[', `]')dnl syscmd([echo 'esyscmd(echo hi >&2 && echo err"print(bye )d"nl)dnl' > tmp.m4 \ -- 1.8.1.4 _______________________________________________ M4-patches mailing list M4-patches@gnu.org https://lists.gnu.org/mailman/listinfo/m4-patches