mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Add some missing checks for EINTR after select(2).
I noticed today that Unix Plink responds to SIGWINCH by accidentally dying of EINTR having interrupted its main select loop, and when I checked, there turn out to be a couple of other select loops with the same bug.
This commit is contained in:
@ -101,7 +101,9 @@ static int block_and_read(int fd, void *buf, size_t len)
|
||||
fd_set rfds;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(fd, &rfds);
|
||||
ret = select(fd+1, &rfds, NULL, NULL, NULL);
|
||||
do {
|
||||
ret = select(fd+1, &rfds, NULL, NULL, NULL);
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
assert(ret != 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user