summaryrefslogtreecommitdiff
path: root/builtin/unpack-file.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-09-25 15:24:06 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-09-25 15:24:06 +0900
commitc50424a6f07f17ff9b06927606df650cd73a09a3 (patch)
tree8dad3903bf837ace4c3e05f223004864aead881d /builtin/unpack-file.c
parentMerge branch 'ez/doc-duplicated-words-fix' (diff)
parentread_pack_header: handle signed/unsigned comparison in read result (diff)
downloadtgif-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 'builtin/unpack-file.c')
-rw-r--r--builtin/unpack-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 281ca1db6c..32e0155577 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -15,7 +15,7 @@ static char *create_temp_file(struct object_id *oid)
xsnprintf(path, sizeof(path), ".merge_file_XXXXXX");
fd = xmkstemp(path);
- if (write_in_full(fd, buf, size) != size)
+ if (write_in_full(fd, buf, size) < 0)
die_errno("unable to write temp-file");
close(fd);
return path;