summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c548cf4)
raw | patch | inline | side by side (parent: c548cf4)
author | Linus Torvalds <torvalds@osdl.org> | |
Sat, 11 Feb 2006 18:41:22 +0000 (10:41 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Feb 2006 00:50:03 +0000 (16:50 -0800) |
We shouldn't fail a fetch just because a signal might have interrupted
the read.
Normally, we don't install any signal handlers, so EINTR really shouldn't
happen. That said, really old versions of Linux will interrupt an
interruptible system call even for signals that turn out to be ignored
(SIGWINCH is the classic example - resizing your xterm would cause it).
The same might well be true elsewhere too.
Also, since receive_keep_pack() doesn't control the caller, it can't know
that no signal handlers exist.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the read.
Normally, we don't install any signal handlers, so EINTR really shouldn't
happen. That said, really old versions of Linux will interrupt an
interruptible system call even for signals that turn out to be ignored
(SIGWINCH is the classic example - resizing your xterm would cause it).
The same might well be true elsewhere too.
Also, since receive_keep_pack() doesn't control the caller, it can't know
that no signal handlers exist.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch-clone.c | patch | blob | history |
diff --git a/fetch-clone.c b/fetch-clone.c
index 873312df3d7ee28f847dfa5886a603981dcce8c2..da1b3ffbaa13ee4dfc8d080759b3f936850b7647 100644 (file)
--- a/fetch-clone.c
+++ b/fetch-clone.c
if (sz == 0)
break;
if (sz < 0) {
- error("error reading pack (%s)", strerror(errno));
- close(ofd);
- unlink(tmpfile);
- return -1;
+ if (errno != EINTR && errno != EAGAIN) {
+ error("error reading pack (%s)", strerror(errno));
+ close(ofd);
+ unlink(tmpfile);
+ return -1;
+ }
+ sz = 0;
}
pos = 0;
while (pos < sz) {