X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-write.c;h=f52cabe83829289dee7e44673b59a02db38918a5;hb=c30e699fc509f43f459c17d3148e7d866fb9157a;hp=665e2b29b8817aa6a8aa83ccd859ab51e7bb2234;hpb=4a44b9ea51ef5183245c23473a33714a62ed224d;p=git.git diff --git a/pack-write.c b/pack-write.c index 665e2b29b..f52cabe83 100644 --- a/pack-write.c +++ b/pack-write.c @@ -139,7 +139,7 @@ char *write_idx_file(char *index_name, struct pack_idx_entry **objects, } sha1write(f, sha1, 20); - sha1close(f, NULL, 1); + sha1close(f, NULL, CSUM_FSYNC); SHA1_Final(sha1, &ctx); return index_name; } @@ -183,7 +183,6 @@ void fixup_pack_header_footer(int pack_fd, char *index_pack_lockfile(int ip_out) { - int len, s; char packname[46]; /* @@ -193,11 +192,8 @@ char *index_pack_lockfile(int ip_out) * case, we need it to remove the corresponding .keep file * later on. If we don't get that then tough luck with it. */ - for (len = 0; - len < 46 && (s = xread(ip_out, packname+len, 46-len)) > 0; - len += s); - if (len == 46 && packname[45] == '\n' && - memcmp(packname, "keep\t", 5) == 0) { + if (read_in_full(ip_out, packname, 46) == 46 && packname[45] == '\n' && + memcmp(packname, "keep\t", 5) == 0) { char path[PATH_MAX]; packname[45] = 0; snprintf(path, sizeof(path), "%s/pack/pack-%s.keep",