[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cat and awk and /dev/full on HP-UX B.11.31

From: Ralf Wildenhues
Subject: cat and awk and /dev/full on HP-UX B.11.31
Date: Sat, 19 Jun 2010 20:27:10 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

On ia64-hp-hpux11.31, cat >/dev/null exits 2 not 1 (which Posix allows),
and awk does not check for write failure, at least not consistently.
This is caught with test 221: AC_CONFIG_FILES, HEADERS, LINKS and

The patch below fixes the first issue:

../../autoconf/tests/ ./config.status --file=-:input </dev/null 
No space left on device
cat: Cannot write to output.
config.status: error: could not create -
../../autoconf/tests/ exit code was 2, expected 1

by accepting any nonzero status.  Note that in a similar situation, we
used to changed lib/autoconf/status.m4 before to exit 1 uniformly, I'm
not really sure which one is more desirable.

The second failure in the same test group is not fixed (but I added the
`|| exit 1' there for good measure, too):

../../autoconf/tests/ ./config.status --header=-:input 
</dev/null >/dev/full || exit 1
+ ./config.status --header=-:input
+ 0< /dev/null 1> /dev/full
../../autoconf/tests/ exit code was 0, expected 1

I've considered piping the result of awk through cat, that would let the
test pass, but that could in practice hide other errors which are
notified by awk, at least on some systems.  I'm not sure that we can fix
this in Autoconf, short of avoiding awk, and I don't think that is
warranted for this limitation.

Would be nice if someone with a HP-UX contract could report this bug
  echo foo | awk '{print}' >/dev/full; echo $?

should not print 0.


    Accept any nonzero exit status upon config.status write failure.
    Normalize nonzero status to 1 for writing to /dev/full, for HP-UX
    11.31 cat which exits 2.  The test still fails because awk does
    not diagnose the write failure.

diff --git a/tests/ b/tests/
index 8ecda23..dc906a8 100644
--- a/tests/
+++ b/tests/
@@ -272,7 +272,7 @@ AT_CHECK([grep from-stdin file], [], [from-stdin
 # Force write error creating a file on stdout
 if test -w /dev/full && test -c /dev/full; then
-  AT_CHECK([./config.status --file=-:input </dev/null >/dev/full],
+  AT_CHECK([./config.status --file=-:input </dev/null >/dev/full || exit 1],
           [1], [ignore], [ignore])
@@ -285,7 +285,7 @@ AT_CHECK([grep OK stdout], [], [OK
 # Force write error creating a header on stdout
 if test -w /dev/full && test -c /dev/full; then
-  AT_CHECK([./config.status --header=-:input </dev/null >/dev/full],
+  AT_CHECK([./config.status --header=-:input </dev/null >/dev/full || exit 1],
           [1], [ignore], [ignore])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]