diff options
Diffstat (limited to 'copy.c')
-rw-r--r-- | copy.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -10,10 +10,13 @@ int copy_fd(int ifd, int ofd) if (!len) break; if (len < 0) { + int read_error; if (errno == EAGAIN) continue; + read_error = errno; + close(ifd); return error("copy-fd: read returned %s", - strerror(errno)); + strerror(read_error)); } while (1) { int written = write(ofd, buf, len); |