From 88506928fc1320528adce6cd8d4c74fd3701d238 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 17 Jan 2018 06:25:05 +0000 Subject: Fix s6-logwatch busyloop issue --- src/minutils/s6-logwatch.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/minutils/s6-logwatch.c b/src/minutils/s6-logwatch.c index 6100cbd..28739af 100644 --- a/src/minutils/s6-logwatch.c +++ b/src/minutils/s6-logwatch.c @@ -129,6 +129,7 @@ int main (int argc, char const *const *argv) if (argc) dir = *argv ; if (chdir(dir) < 0) strerr_diefu2sys(111, "chdir to ", dir) ; + if (!fd_sanitize()) strerr_diefu1sys(111, "sanitize standard fds") ; x[0].fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC) ; if (x[0].fd < 0) strerr_diefu1sys(111, "inotify_init") ; @@ -159,6 +160,7 @@ int main (int argc, char const *const *argv) { if (!buffer_flush(buffer_1) && !error_isagain(errno)) strerr_diefu1sys(111, "write to stdout") ; + if (x[1].revents & IOPAUSE_EXCEPT) break ; } if (state == B_READING && buffer_available(buffer_1)) { -- cgit v1.2.3