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
1 changed files with 2 additions and 1 deletions

3
dd.c
View File

@ -162,7 +162,8 @@ copy_splice(struct dd_config *ddc)
FD_ZERO(&wfd);
FD_SET(ifd, &rfd);
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;
break;
}