From 6894f8472614e22c76820b6469d2551d17e024ed Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 19 Jan 2017 11:45:01 -0500 Subject: fix spurious EINTR errors from multithreaded set*id, etc. commit 78a8ef47c4d92b7680c52a85f80a81e29da86bb9 inadvertently removed the SA_RESTART flag from the sigaction for the internal signal handler used by __synccall for broadcasting. as a result, programs which did not use interrupting signals but which used set*id() in a multithreaded context could wrongly observe EINTR errors they're not prepared to handle. --- src/thread/synccall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/thread/synccall.c') diff --git a/src/thread/synccall.c b/src/thread/synccall.c index 000ec4e3..f6813576 100644 --- a/src/thread/synccall.c +++ b/src/thread/synccall.c @@ -50,7 +50,7 @@ void __synccall(void (*func)(void *), void *ctx) int cs, i, r, pid, self;; DIR dir = {0}; struct dirent *de; - struct sigaction sa = { .sa_flags = 0, .sa_handler = handler }; + struct sigaction sa = { .sa_flags = SA_RESTART, .sa_handler = handler }; struct chain *cp, *next; struct timespec ts; -- cgit v1.2.1