Browse Source

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

* jk/read-in-full-stops-on-error:
  read_in_full: always report errors
maint
Junio C Hamano 14 years ago
parent
commit
27c6729201
  1. 6
      wrapper.c

6
wrapper.c

@ -148,8 +148,10 @@ ssize_t read_in_full(int fd, void *buf, size_t count) @@ -148,8 +148,10 @@ ssize_t read_in_full(int fd, void *buf, size_t count)

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;

Loading…
Cancel
Save