commit 4658c489ac59332742b577cb38a6573ef5ab01dd
parent bbcebaa7ac43f0ce281f8b9901e8070819d8f4be
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Sun, 9 Aug 2015 17:20:13 +0000
ucspilogd: allow last log line to not be null-terminated
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/daemontools-extras/ucspilogd.c b/src/daemontools-extras/ucspilogd.c
@@ -160,7 +160,11 @@ int main (int argc, char const *const *argv, char const *const *envp)
satmp.len = 0 ;
{
register int r = skagetlnsep(buffer_0f1, &satmp, "\n", 2) ;
- if (r < 0) strerr_diefu1sys(111, "read from stdin") ;
+ if (r < 0)
+ {
+ if (errno != EPIPE || !stralloc_0(&satmp))
+ strerr_diefu1sys(111, "read from stdin") ;
+ }
if (!r) break ;
}
if (!satmp.len) continue ;