aboutsummaryrefslogtreecommitdiffstats
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-23 14:37:21 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-23 14:37:22 +0900
commit96c6bb566ee5354a1b07530a94d3f85055e46032 (patch)
tree675b4ea93a5c4ffd9db000608d23a794f6cf7d4e /transport-helper.c
parent7186408f2486ebbb82736c15efb8fbc372fb5f95 (diff)
parentf48ecd38cb86b86f01914e875d74c92c077bf493 (diff)
downloadgit-96c6bb566ee5354a1b07530a94d3f85055e46032.tar.gz
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 'transport-helper.c')
-rw-r--r--transport-helper.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 2b830b2290..a72ed18efb 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -44,8 +44,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)
{
if (debug)
fprintf(stderr, "Debug: Remote helper: -> %s", buffer->buf);
- if (write_in_full(helper->helper->in, buffer->buf, buffer->len)
- != buffer->len)
+ if (write_in_full(helper->helper->in, buffer->buf, buffer->len) < 0)
die_errno("Full write to remote helper failed");
}
@@ -74,7 +73,7 @@ static void write_constant(int fd, const char *str)
{
if (debug)
fprintf(stderr, "Debug: Remote helper: -> %s", str);
- if (write_in_full(fd, str, strlen(str)) != strlen(str))
+ if (write_in_full(fd, str, strlen(str)) < 0)
die_errno("Full write to remote helper failed");
}