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
This commit is contained in:
@ -1850,7 +1850,7 @@ int index_path(struct object_id *oid, const char *path, struct stat *st, unsigne
|
||||
|
||||
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;
|
||||
|
||||
|
Reference in New Issue
Block a user