Commits

Anonymous 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

Comments (0)

Files changed (1)

 
 	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;