summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-23 05:37:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-23 05:37:22 (GMT)
commit96c6bb566ee5354a1b07530a94d3f85055e46032 (patch)
tree675b4ea93a5c4ffd9db000608d23a794f6cf7d4e /sha1_file.c
parent7186408f2486ebbb82736c15efb8fbc372fb5f95 (diff)
parentf48ecd38cb86b86f01914e875d74c92c077bf493 (diff)
downloadgit-96c6bb566ee5354a1b07530a94d3f85055e46032.zip
git-96c6bb566ee5354a1b07530a94d3f85055e46032.tar.gz
git-96c6bb566ee5354a1b07530a94d3f85055e46032.tar.bz2
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 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 5911364..4d0e0c5 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3715,7 +3715,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned
int read_pack_header(int fd, struct pack_header *header)
{
- if (read_in_full(fd, header, sizeof(*header)) < sizeof(*header))
+ if (read_in_full(fd, header, sizeof(*header)) != sizeof(*header))
/* "eof before pack header was fully read" */
return PH_ERROR_EOF;