]> git.ipfire.org Git - thirdparty/git.git/blobdiff - index-pack.c
short i/o: fix calls to read to use xread or read_in_full
[thirdparty/git.git] / index-pack.c
index 5f6d128a836f8ed9447f81280ae679e19c9939ff..e9a53032226edd5663458031734c135afb5db0ef 100644 (file)
@@ -638,7 +638,7 @@ static void readjust_pack_header_and_sha1(unsigned char *sha1)
        /* Rewrite pack header with updated object number */
        if (lseek(output_fd, 0, SEEK_SET) != 0)
                die("cannot seek back: %s", strerror(errno));
-       if (xread(output_fd, &hdr, sizeof(hdr)) != sizeof(hdr))
+       if (read_in_full(output_fd, &hdr, sizeof(hdr)) != sizeof(hdr))
                die("cannot read pack header back: %s", strerror(errno));
        hdr.hdr_entries = htonl(nr_objects);
        if (lseek(output_fd, 0, SEEK_SET) != 0)