Ralf Wildenhues <[EMAIL PROTECTED]> 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) = ? _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils