diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-03-31 12:16:44 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-04-02 07:45:58 -0700 |
commit | 9111dd2499ca5c26d2658bf85966e8160f51d280 (patch) | |
tree | 0e25c140b0dec0fcec211c5b698d465f47cf276c /NEWS | |
parent | d08381bc261d95502a205f7214686f80383c9692 (diff) | |
download | coreutils-9111dd2499ca5c26d2658bf85966e8160f51d280.tar.xz |
head: port to Darwin and use simpler seeks
This removes an unportable assumption that if lseek succeeds, the
file is capable of seeking. See: http://bugs.gnu.org/17145
* src/head.c (elseek): New function, for consistency in reporting
lseek failures.
(elide_tail_bytes_file, elide_tail_lines_seekable)
(elide_tail_lines_file, head_lines, head): Use it.
(elide_tail_bytes_file, elide_tail_lines_file):
New args CURRENT_POS and SIZE. All uses changed. Don't bother
invoking lseek, since we know the file's pos and size now.
(elide_tail_bytes_file): Change a local from uintmax_t to off_t,
since it fits.
(head): Use lseek only on regular files, since its behavior on
unseekable devices is implementation-defined.
* NEWS: Document this.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -20,6 +20,11 @@ GNU coreutils NEWS -*- outline -*- date could crash or go into an infinite loop when parsing a malformed TZ="". [bug introduced with the --date='TZ="" ..' parsing feature in coreutils-5.3.0] + head --bytes=-N and --lines=-N now handles devices more + consistently, not ignoring data from virtual devices like /dev/zero, + or on BSD systems data from tty devices. + [bug introduced in coreutils-5.0.1] + head --bytes=-N - no longer fails with a bogus diagnostic when stdin's seek pointer is not at the beginning. [bug introduced with the --bytes=-N feature in coreutils-5.0.1] |