Hi Eric, Thanks for working on this.
On 13 Mar 2013, at 06:30, Eric Blake <ebl...@redhat.com> wrote: > 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. Not quite, the test is not skipped with your patch applied as is: hppa11.31% /bin/cat <&- 2>/dev/null hppa11.31% echo $? 2 hppa11.11% /bin/cat <&- 2>/dev/null hppa11.11% echo $? 0 And yet, per my original report: hppa11.31% echo | /bin/cat >&- 2>/dev/null hppa11.31% echo $? 0 hppa11.11% echo | /bin/cat >&- 2>/dev/null hppa11.11% echo 1 > @@ -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 Taking into account the bizzare difference between stdin and stdout behaviour, this works for me: 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 @@ 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 And similarly, above. Of course this reveals some more gnulib testsuite failures on ia64*-hpux*, but that's another story... ;) Cheers, -- Gary V. Vaughan (gary AT gnu DOT org) _______________________________________________ M4-patches mailing list M4-patches@gnu.org https://lists.gnu.org/mailman/listinfo/m4-patches