summaryrefslogtreecommitdiff
path: root/pack-write.c
diff options
context:
space:
mode:
authorHeikki Orsila <heikki.orsila@iki.fi>2008-05-03 13:27:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-04 05:15:25 (GMT)
commitc697ad143ba1ff58b29e7efe149d244d4b7010a5 (patch)
tree7d3446a01ad6e3f37dd318e0e29d57da21024366 /pack-write.c
parent471793f91e4bd61bb809045c7088a30ee1305a19 (diff)
downloadgit-c697ad143ba1ff58b29e7efe149d244d4b7010a5.zip
git-c697ad143ba1ff58b29e7efe149d244d4b7010a5.tar.gz
git-c697ad143ba1ff58b29e7efe149d244d4b7010a5.tar.bz2
Cleanup xread() loops to use read_in_full()
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-write.c')
-rw-r--r--pack-write.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/pack-write.c b/pack-write.c
index 665e2b2..c66c8af 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -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",