aboutsummaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-25 15:24:06 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-25 15:24:06 +0900
commitc50424a6f07f17ff9b06927606df650cd73a09a3 (patch)
tree8dad3903bf837ace4c3e05f223004864aead881d /transport-helper.c
parent94982b69994c448dafbc0721398f8944ab5856e3 (diff)
parentf48ecd38cb86b86f01914e875d74c92c077bf493 (diff)
downloadgit-c50424a6f07f17ff9b06927606df650cd73a09a3.tar.gz
git-c50424a6f07f17ff9b06927606df650cd73a09a3.tar.xz
Merge branch 'jk/write-in-full-fix'
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 42b960ff8..c948d5215 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");
}