1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed 27c6729 Merge

Merge branch 'jk/read-in-full-stops-on-error'

* jk/read-in-full-stops-on-error:
read_in_full: always report errors

  • Participants
  • Parent commits 2cd517c, 56d7c27
  • Branches master

Comments (0)

Files changed (1)

File wrapper.c

View file
 
 	while (count > 0) {
 		ssize_t loaded = xread(fd, p, count);
-		if (loaded <= 0)
-			return total ? total : loaded;
+		if (loaded < 0)
+			return -1;
+		if (loaded == 0)
+			return total;
 		count -= loaded;
 		p += loaded;
 		total += loaded;