Merge branch 'maint'
* maint: Do not use errno when pread() returns 0 git init: --bare/--shared overrides system/global config git-push.txt: Describe --repo option in more detail git rm: refresh index before up-to-date check Fix a few typos in relnotes
This commit is contained in:
@ -365,8 +365,11 @@ static void *get_data_from_pack(struct object_entry *obj)
|
||||
data = src;
|
||||
do {
|
||||
ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
|
||||
if (n <= 0)
|
||||
if (n < 0)
|
||||
die("cannot pread pack file: %s", strerror(errno));
|
||||
if (!n)
|
||||
die("premature end of pack file, %lu bytes missing",
|
||||
len - rdy);
|
||||
rdy += n;
|
||||
} while (rdy < len);
|
||||
data = xmalloc(obj->size);
|
||||
|
Reference in New Issue
Block a user