summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-02-03 22:16:29 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-02-03 22:16:29 +0100
commita61d96ff6a34990be1f2e2099bd8f6ced80fdf77 (patch)
treee031d9d4160576b74ab87cd9a2e8062707dbda94
parent2bd5e698ae6fd85d6671cd9cad94abaa0cd5d92d (diff)
downloadrvnit-a61d96ff6a34990be1f2e2099bd8f6ced80fdf77.tar.gz
rvnit-a61d96ff6a34990be1f2e2099bd8f6ced80fdf77.tar.xz
rvnit-a61d96ff6a34990be1f2e2099bd8f6ced80fdf77.zip
detect close of selflog when POLLIN was set
-rw-r--r--rvnit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rvnit.c b/rvnit.c
index 8c7b36b..dcacdf1 100644
--- a/rvnit.c
+++ b/rvnit.c
@@ -486,6 +486,10 @@ closed_pipe:
 			if (rd == 0) {
 				// some OS set POLLIN|POLLHUP on closed pipes
 				// https://www.greenend.org.uk/rjk/tech/poll.html
+				if (j == 1 && n == 1) {
+					/* selflog was closed, end thread */
+					break;
+				}
 				goto closed_pipe;
 			}