From 4658c489ac59332742b577cb38a6573ef5ab01dd Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 9 Aug 2015 17:20:13 +0000 Subject: ucspilogd: allow last log line to not be null-terminated --- src/daemontools-extras/ucspilogd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/daemontools-extras') diff --git a/src/daemontools-extras/ucspilogd.c b/src/daemontools-extras/ucspilogd.c index cf1ae37..3e6cf9b 100644 --- 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 ; -- cgit v1.2.3