diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-17 06:25:05 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-17 06:25:05 +0000 |
commit | 88506928fc1320528adce6cd8d4c74fd3701d238 (patch) | |
tree | ef20cd61dee8172e93284822bfa8ed03e79be44c | |
parent | f1480089f1c61fe66122368c7e436ba741881c87 (diff) | |
download | s6-linux-utils-88506928fc1320528adce6cd8d4c74fd3701d238.tar.xz |
Fix s6-logwatch busyloop issue
-rw-r--r-- | src/minutils/s6-logwatch.c | 2 |
1 files changed, 2 insertions, 0 deletions
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)) { |