Commit Diff


commit - 92698c5e983ce2fa59780f5567cb34283bcf1095
commit + 674563ab136a2aa34dc4d93043d92235a2ae98ba
blob - dd6b2aa9dd850690d77fb00149d2331f76b827e3
blob + 238ecb9d0ee975efd8eacc55de14b8cfb69792de
--- lib/diff_atomize_text.c
+++ lib/diff_atomize_text.c
@@ -64,7 +64,7 @@ diff_data_atomize_text_lines_fd(struct diff_data *d)
 		while (eol == 0 && line_end < end) {
 			r = fread(buf, sizeof(char), sizeof(buf), d->root->f);
 			if (r == 0 && ferror(d->root->f))
-				return errno;
+				return EIO;
 			i = 0;
 			while (eol == 0 && i < r) {
 				if (buf[i] != '\r' && buf[i] != '\n') {
@@ -91,7 +91,7 @@ diff_data_atomize_text_lines_fd(struct diff_data *d)
 				return errno;
 			r = fread(buf, sizeof(char), sizeof(buf), d->root->f);
 			if (r == 0 && ferror(d->root->f))
-				return errno;
+				return EIO;
 			if (r > 0 && buf[0] == '\n')
 				line_end++;
 		}
blob - 325830b65763ecd28f365b69cfc7091b6445971f
blob + 00a42243cafc3f305b117bd3a861bb075aeee435
--- lib/diff_main.c
+++ lib/diff_main.c
@@ -43,7 +43,7 @@ read_at(FILE *f, off_t at_pos, unsigned char *buf, siz
 		return errno;
 	r = fread(buf, sizeof(char), len, f);
 	if ((r == 0 || r < len) && ferror(f))
-		return errno;
+		return EIO;
 	if (r != len)
 		return EIO;
 	return 0;