bug-coreutils
[Top][All Lists]
Advanced

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

Re: 5.96: 3 test failures on HP-UX 11.23


From: Paul Eggert
Subject: Re: 5.96: 3 test failures on HP-UX 11.23
Date: Tue, 30 May 2006 01:42:06 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> (I assume you meant "... >&- 2>/dev/null".)

Yes, thanks.  Actually, the "2>/dev/null" can be omitted.


> Seems "fclose (stdout)" isn't returning an error in this case.

Ouch.  I suppose one possibility is a bug in the HP-UX C library.

Another is that stdout happens to be open somehow.
To test the latter hypothesis, can you run the HP-UX equivalent of
"strace -o /tmp/tr cp --verbose /dev/null /tmp/foo >&-"
to see whether stdout is closed?
If not, I suppose you can run the debugger, plant a breakpoint
at close_stdout, and see what close(1) returns.

Here's what the tail of that strace looks like on a GNU/Linux machine.

open("/dev/null", O_RDONLY|O_LARGEFILE) = 1
fcntl64(1, F_DUPFD, 3)                  = 3
close(1)                                = 0
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
open("/tmp/foo", O_WRONLY|O_TRUNC|O_LARGEFILE) = 1
fcntl64(1, F_DUPFD, 3)                  = 4
close(1)                                = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
read(3, "", 4096)                       = 0
close(4)                                = 0
close(3)                                = 0
write(1, "`/dev/null\' -> `/tmp/foo\'\n", 26) = -1 EBADF (Bad file descriptor)
close(1)                                = -1 EBADF (Bad file descriptor)
munmap(0x40018000, 8192)                = 0
write(2, "cp: ", 4)                     = 4
write(2, "write error", 11)             = 11
write(2, ": Bad file descriptor", 21)   = 21
write(2, "\n", 1)                       = 1
exit_group(1)                           = ?




reply via email to

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