summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2026-04-26 23:22:46 -0400
committerJune McEnroe <june@causal.agency>2026-04-26 23:22:46 -0400
commitbe5013d805f97a8eeba3ceb9f753495c3b4f4f78 (patch)
treeef326befeb2eeedc37d099640e4a6b92fcbac776 /bin
parentAdd dais from Left Hand of Darkness (diff)
downloadsrc-be5013d805f97a8eeba3ceb9f753495c3b4f4f78.tar.gz
src-be5013d805f97a8eeba3ceb9f753495c3b4f4f78.zip
Retry on EINTR from waitpid(2) HEAD master
This was reported by hovsater on IRC but I only saw it on my phone
and I guess am missing logs for it. In any case the link to their
patch is expired, so I wrote this.
Diffstat (limited to 'bin')
-rw-r--r--bin/qf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/qf.c b/bin/qf.c
index afa7eced..d0d3acf4 100644
--- a/bin/qf.c
+++ b/bin/qf.c
@@ -17,6 +17,7 @@
 #include <ctype.h>
 #include <curses.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
 #include <regex.h>
@@ -182,7 +183,9 @@ static void edit(struct Line line) {
 		err(127, "%s", editor);
 	}
 	int status;
-	pid = waitpid(pid, &status, 0);
+	do {
+		pid = waitpid(pid, &status, 0);
+	} while (pid < 0 && errno == EINTR);
 	if (pid < 0) err(1, "waitpid");
 }