From ae5bd54066fc78455eb0e53956ec4c10ad0e03b9 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sun, 11 May 2025 19:28:38 +0300 Subject: Add check for EINTR on braoadcast writing When signal occures, write can return with EINTR and shouls be recalled then see: signal(7) --- ttb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ttb.c b/ttb.c index 48e73c5..8f0c561 100644 --- a/ttb.c +++ b/ttb.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -103,7 +104,7 @@ after: for (size_t j = 1; j < lengthof(peers); ++j) if (peers[j] && i != j) - write(peers[j], buf, reads); + while (errno = 0, write(peers[j], buf, reads), errno == EINTR); } } } -- cgit 1.4.1