diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-25 15:24:06 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-25 15:24:06 +0900 |
commit | c50424a6f07f17ff9b06927606df650cd73a09a3 (patch) | |
tree | 8dad3903bf837ace4c3e05f223004864aead881d /builtin/get-tar-commit-id.c | |
parent | Merge branch 'ez/doc-duplicated-words-fix' (diff) | |
parent | read_pack_header: handle signed/unsigned comparison in read result (diff) | |
download | tgif-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/get-tar-commit-id.c')
-rw-r--r-- | builtin/get-tar-commit-id.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c index e21c5416cd..6d9a79f9b3 100644 --- a/builtin/get-tar-commit-id.c +++ b/builtin/get-tar-commit-id.c @@ -33,8 +33,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix) if (!skip_prefix(content, "52 comment=", &comment)) return 1; - n = write_in_full(1, comment, 41); - if (n < 41) + if (write_in_full(1, comment, 41) < 0) die_errno("git get-tar-commit-id: write error"); return 0; |