projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da93d12
)
safe_fgets() - even more anal fgets()
author
Junio C Hamano
<junkio@cox.net>
Tue, 4 Apr 2006 06:41:09 +0000
(23:41 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 4 Apr 2006 06:42:25 +0000
(23:42 -0700)
This is from Linus -- the previous round forgot to clear error
after EINTR case.
Signed-off-by: Junio C Hamano <junkio@cox.net>
pack-objects.c
patch
|
blob
|
history
diff --git
a/pack-objects.c
b/pack-objects.c
index 084c2006a987c79dfbd2f70c616d46eac23ed50d..7d6247791d9374986c6fb85159433ecd91b9ccec 100644
(file)
--- 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) {