Browse Source

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>
maint
Junio C Hamano 19 years ago
parent
commit
687dd75c95
  1. 7
      pack-objects.c

7
pack-objects.c

@ -915,9 +915,10 @@ int main(int argc, char **argv) @@ -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) {

Loading…
Cancel
Save