mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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:
5
entry.c
5
entry.c
@@ -257,7 +257,8 @@ static int write_entry(struct cache_entry *ce,
|
||||
char *new;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
unsigned long size;
|
||||
size_t wrote, newsize = 0;
|
||||
ssize_t wrote;
|
||||
size_t newsize = 0;
|
||||
struct stat st;
|
||||
const struct submodule *sub;
|
||||
|
||||
@@ -332,7 +333,7 @@ static int write_entry(struct cache_entry *ce,
|
||||
fstat_done = fstat_output(fd, state, &st);
|
||||
close(fd);
|
||||
free(new);
|
||||
if (wrote != size)
|
||||
if (wrote < 0)
|
||||
return error("unable to write file %s", path);
|
||||
break;
|
||||
case S_IFGITLINK:
|
||||
|
||||
Reference in New Issue
Block a user