summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-03-09 02:31:18 +0000
committerLaurent Bercot <ska@appnovation.com>2023-03-09 02:31:18 +0000
commit1eab430a3606a5fd62ec72a5f46c2e86face77f9 (patch)
tree4385c276b8cd51afb4915da9e186df82b2f3301f
parentf1244c8673a09df71a003cbd93b0c31dd4b53c54 (diff)
downloads6-portable-utils-1eab430a3606a5fd62ec72a5f46c2e86face77f9.tar.xz
bugfix: adapt s6-head to (not so) new allread api
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/s6-portable-utils/s6-head.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/s6-portable-utils/s6-head.c b/src/s6-portable-utils/s6-head.c
index de7d937..fc5f8f9 100644
--- a/src/s6-portable-utils/s6-head.c
+++ b/src/s6-portable-utils/s6-head.c
@@ -65,6 +65,7 @@ static int head_safedolines (int fd, size_t lines)
errno = 0 ;
r = allread(fd, tmp, lines) ;
if (r < lines && errno) return 0 ;
+ if (!r) break ;
lines -= byte_count(tmp, r, '\n') ;
if (buffer_put(buffer_1, tmp, r) < (ssize_t)r) return 0 ;
}