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>
This commit is contained in:
Junio C Hamano 2006-04-03 23:41:09 -07:00
parent da93d12b00
commit 687dd75c95

View file

@ -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) {