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.
This commit is contained in:
committed by
Alex Chernyakhovsky
parent
3f91cce5ff
commit
8e472066be
+1
-1
@@ -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 ) );
|
||||
|
||||
Reference in New Issue
Block a user