summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-10-09 13:36:39 -0400
committerJune McEnroe <june@causal.agency>2023-10-09 13:36:39 -0400
commit7be202d1db19581c8420af64b684829ae346f6cf (patch)
treeebb8171ff97c3de7efc4f626f774ee8f3351145f
parentUse setitimer(2) (diff)
downloadkitd-7be202d1db19581c8420af64b684829ae346f6cf.tar.gz
kitd-7be202d1db19581c8420af64b684829ae346f6cf.zip
Set signal mask and use ppoll
-rw-r--r--kitd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kitd.c b/kitd.c
index 2961820..d3dbe3b 100644
--- a/kitd.c
+++ b/kitd.c
@@ -157,6 +157,10 @@ int main(int argc, char *argv[]) {
 	struct timeval interval = restart;
 	signals[SIGALRM] = 1;
 
+	sigset_t mask, unmask;
+	sigfillset(&mask);
+	sigemptyset(&unmask);
+	sigprocmask(SIG_SETMASK, &mask, NULL);
 	struct pollfd fds[2] = {
 		{ .fd = stdoutRW[0], .events = POLLIN },
 		{ .fd = stderrRW[0], .events = POLLIN },
@@ -259,7 +263,7 @@ int main(int argc, char *argv[]) {
 			signals[SIGINFO] = 0;
 		}
 
-		int nfds = poll(fds, 2, -1);
+		int nfds = ppoll(fds, 2, NULL, &unmask);
 		if (nfds < 0 && errno != EINTR) {
 			syslog(LOG_ERR, "poll: %m");
 			continue;
ef='/libretls/commit/man/Makefile.am?h=3.3.4&id=3b4a10a68682f3b8590450c9be75a8ed4c7307c4&follow=1'>Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe