Ensure a select() failure is properly signalled to the caller

This commit is contained in:
sin 2014-06-11 13:03:33 +01:00
parent d2c215f9ab
commit d3e332c72d

3
dd.c
View File

@ -162,7 +162,8 @@ copy_splice(struct dd_config *ddc)
FD_ZERO(&wfd); FD_ZERO(&wfd);
FD_SET(ifd, &rfd); FD_SET(ifd, &rfd);
FD_SET(ofd, &wfd); FD_SET(ofd, &wfd);
if (select(ifd > ofd ? ifd + 1 : ofd + 1, &rfd, &wfd, NULL, NULL) < 0) { r = select(ifd > ofd ? ifd + 1 : ofd + 1, &rfd, &wfd, NULL, NULL);
if (r < 0) {
ddc->saved_errno = errno; ddc->saved_errno = errno;
break; break;
} }