From 1eab430a3606a5fd62ec72a5f46c2e86face77f9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 9 Mar 2023 02:31:18 +0000 Subject: bugfix: adapt s6-head to (not so) new allread api Signed-off-by: Laurent Bercot --- src/s6-portable-utils/s6-head.c | 1 + 1 file changed, 1 insertion(+) 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 ; } -- cgit v1.2.3