From 8e472066be935927f69e7e172947b3c5a2f46738 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 27 Jan 2026 03:08:12 -0500 Subject: [PATCH] select: use SA_RESTART with signals Rely on the OS to automatically restart syscalls that were interrupted by signals. This makes code overall more robust because we don't have to explicitly handle EINTR everywhere ourselves. --- src/util/select.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/select.h b/src/util/select.h index 82022e5..39a4d72 100644 --- a/src/util/select.h +++ b/src/util/select.h @@ -108,7 +108,7 @@ public: /* Register a handler, which will only be called when pselect() is interrupted by a (possibly queued) signal. */ struct sigaction sa; - sa.sa_flags = 0; + sa.sa_flags = SA_RESTART; sa.sa_handler = &handle_signal; fatal_assert( 0 == sigfillset( &sa.sa_mask ) ); fatal_assert( 0 == sigaction( signum, &sa, NULL ) );