Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/packfile.c b/packfile.c
index 518d9d5b54..fdb33fda81 100644
--- a/packfile.c
+++ b/packfile.c
@@ -555,9 +555,8 @@ static int open_packed_git_1(struct packed_git *p)
" while index indicates %"PRIu32" objects",
p->pack_name, ntohl(hdr.hdr_entries),
p->num_objects);
- if (lseek(p->pack_fd, p->pack_size - hashsz, SEEK_SET) == -1)
- return error("end of packfile %s is unavailable", p->pack_name);
- read_result = read_in_full(p->pack_fd, hash, hashsz);
+ read_result = pread_in_full(p->pack_fd, hash, hashsz,
+ p->pack_size - hashsz);
if (read_result < 0)
return error_errno("error reading from %s", p->pack_name);
if (read_result != hashsz)