Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/copy.c b/copy.c
index 20092757d3..e1cd5d0650 100644
--- a/copy.c
+++ b/copy.c
@@ -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);