Commits

Junio C Hamano  committed 687dd75

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>

  • Participants
  • Parent commits da93d12

Comments (0)

Files changed (1)

File pack-objects.c

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