summaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorLibravatar J. Bruce Fields <bfields@citi.umich.edu>2007-01-14 19:27:28 -0500
committerLibravatar J. Bruce Fields <bfields@citi.umich.edu>2007-01-14 19:27:28 -0500
commit67583917e9a2a85605c1123a62c8883593e7e889 (patch)
tree06f61d2f28e321063b8e1e206a0e418bc1ba0486 /builtin-rerere.c
parentuser-manual: reindent (diff)
parentMerge branch 'jc/int' (diff)
downloadtgif-67583917e9a2a85605c1123a62c8883593e7e889.tar.xz
Merge branch 'master' of git://git.kernel.org/pub/scm/git/git
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r--builtin-rerere.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 079c0bdf36..318d959d89 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -51,9 +51,11 @@ static int write_rr(struct path_list *rr, int out_fd)
int i;
for (i = 0; i < rr->nr; i++) {
const char *path = rr->items[i].path;
- write(out_fd, rr->items[i].util, 40);
- write(out_fd, "\t", 1);
- write(out_fd, path, strlen(path) + 1);
+ int length = strlen(path) + 1;
+ if (write_in_full(out_fd, rr->items[i].util, 40) != 40 ||
+ write_in_full(out_fd, "\t", 1) != 1 ||
+ write_in_full(out_fd, path, length) != length)
+ die("unable to write rerere record");
}
close(out_fd);
return commit_lock_file(&write_lock);
@@ -244,7 +246,8 @@ static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)
{
int i;
for (i = 0; i < nbuf; i++)
- write(1, ptr[i].ptr, ptr[i].size);
+ if (write_in_full(1, ptr[i].ptr, ptr[i].size) != ptr[i].size)
+ return -1;
return 0;
}