summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 975b31d)
raw | patch | inline | side by side (parent: 975b31d)
author | Sam Ravnborg <sam@ravnborg.org> | |
Tue, 27 Dec 2005 08:19:05 +0000 (09:19 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 27 Dec 2005 18:49:25 +0000 (10:49 -0800) |
In copy_fd when write fails we ought to close input file descriptor.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
copy.c | patch | blob | history |
index 7100eedbc3277b9b0997311459d054ba06950b61..08a3d388a4c312fca18558b2b8e5dcf027c7afaf 100644 (file)
--- a/copy.c
+++ b/copy.c
buf += written;
len -= written;
}
- else if (!written)
+ else if (!written) {
+ close(ifd);
return error("copy-fd: write returned 0");
- else
+ } else {
+ close(ifd);
return error("copy-fd: write returned %s",
strerror(errno));
+ }
}
}
close(ifd);