Handle EINTR from write(2) when writing to pipes and socket pairs.

This commit is contained in:
Todd C. Miller
2014-05-27 10:16:49 -06:00
parent 9e5a68627f
commit d628e17ead
3 changed files with 28 additions and 7 deletions

View File

@@ -102,7 +102,10 @@ sudo_handler(int signo)
* The pipe is non-blocking, if we overflow the kernel's pipe
* buffer we drop the signal. This is not a problem in practice.
*/
ignore_result(write(signal_pipe[1], &signo, sizeof(signo)));
while (write(signal_pipe[1], &signo, sizeof(signo)) == -1) {
if (errno != EINTR)
break;
}
}
/*