]> git.ipfire.org Git - thirdparty/coreutils.git/commit
head: simplify head_bytes
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Jul 2025 18:40:33 +0000 (11:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:04 +0000 (19:48 -0700)
commitc9e2dd531dc8bad5af7dfec3f7ecd961f40c5866
tree1ce0584dbe54e732340c4b3ff990fc89f7e0c228
parentca30c06e4cd0dbd74d9c95ccc2b05cb26bd053a3
head: simplify head_bytes

* src/head.c (diagnose_read_failure): New function.
Use it when possible, to simplify callers.
(head_bytes): Use copy_fd and diagnose_copy_fd_failure instead of
reinventing the wheel.
src/head.c