summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-04 06:41:09 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-04 06:42:25 (GMT)
commit687dd75c95f9212244b6cf4fe60b40db44de01ba (patch)
treeeb571e0451106ce1a69edb45e1104bfca0566c19 /pack-objects.c
parentda93d12b00425a37e81e227671f13130efcfe93f (diff)
downloadgit-687dd75c95f9212244b6cf4fe60b40db44de01ba.zip
git-687dd75c95f9212244b6cf4fe60b40db44de01ba.tar.gz
git-687dd75c95f9212244b6cf4fe60b40db44de01ba.tar.bz2
safe_fgets() - even more anal fgets()
This is from Linus -- the previous round forgot to clear error after EINTR case. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pack-objects.c b/pack-objects.c
index 084c200..7d62477 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -915,9 +915,10 @@ int main(int argc, char **argv)
break;
if (!ferror(stdin))
die("fgets returned NULL, not EOF, not error!");
- if (errno == EINTR)
- continue;
- die("fgets: %s", strerror(errno));
+ if (errno != EINTR)
+ die("fgets: %s", strerror(errno));
+ clearerr(stdin);
+ continue;
}
if (progress_update) {