From 790892db657ac79b0ba5f7a69cc7e70eb4fed8e0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 8 Jun 2006 20:13:37 +0000 Subject: Ensure that cat works with any of the options, -A -v -e -E -T, when applied to files in /proc and /sys, even when the FIONREAD ioctl produces nonsensical results. Before this change, cat would produce no output (or truncated output), for some linux kernels. * src/cat.c (write_pending): New function, factored out of cat. (cat): Also interpret a negative ioctl/FIONREAD count as indicating that there are bytes to read. Some versions of linux-2.6.16 do that. Write any pending output before returning. Reported by Dan Jacobson in . * NEWS: Mention this bug fix. * tests/misc/cat-proc: New file. Test for the above. * tests/misc/Makefile.am (TESTS): Add cat-proc. --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index be511eb25..fdca45225 100644 --- a/NEWS +++ b/NEWS @@ -138,6 +138,10 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + cat with any of the options, -A -v -e -E -T, when applied to a + file in /proc or /sys (linux-specific), would truncate its output, + usually printing nothing. + cp -p would fail in a /proc-less chroot, on some systems When `cp -RL' encounters the same directory more than once in the -- cgit v1.2.3-54-g00ecf