Ensure a select() failure is properly signalled to the caller
This commit is contained in:
parent
d2c215f9ab
commit
d3e332c72d
3
dd.c
3
dd.c
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user