diff options
| author | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:37:21 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:37:22 +0900 |
| commit | 96c6bb566ee5354a1b07530a94d3f85055e46032 (patch) | |
| tree | 675b4ea93a5c4ffd9db000608d23a794f6cf7d4e /http-backend.c | |
| parent | 7186408f2486ebbb82736c15efb8fbc372fb5f95 (diff) | |
| parent | f48ecd38cb86b86f01914e875d74c92c077bf493 (diff) | |
Merge branch 'jk/write-in-full-fix' into maint
Many codepaths did not diagnose write failures correctly when disks
go full, due to their misuse of write_in_full() helper function,
which have been corrected.
* jk/write-in-full-fix:
read_pack_header: handle signed/unsigned comparison in read result
config: flip return value of store_write_*()
notes-merge: use ssize_t for write_in_full() return value
pkt-line: check write_in_full() errors against "< 0"
convert less-trivial versions of "write_in_full() != len"
avoid "write_in_full(fd, buf, len) != len" pattern
get-tar-commit-id: check write_in_full() return against 0
config: avoid "write_in_full(fd, buf, len) < len" pattern
Diffstat (limited to 'http-backend.c')
| -rw-r--r-- | http-backend.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/http-backend.c b/http-backend.c index 519025d2c3..5daff8ccab 100644 --- a/http-backend.c +++ b/http-backend.c @@ -357,7 +357,7 @@ static void inflate_request(const char *prog_name, int out, int buffer_input) die("zlib error inflating request, result %d", ret); n = stream.total_out - cnt; - if (write_in_full(out, out_buf, n) != n) + if (write_in_full(out, out_buf, n) < 0) die("%s aborted reading request", prog_name); cnt += n; @@ -378,7 +378,7 @@ static void copy_request(const char *prog_name, int out) ssize_t n = read_request(0, &buf); if (n < 0) die_errno("error reading request body"); - if (write_in_full(out, buf, n) != n) + if (write_in_full(out, buf, n) < 0) die("%s aborted reading request", prog_name); close(out); free(buf); |
