summaryrefslogtreecommitdiff
path: root/bundle.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2008-01-10 09:54:25 +0100
committerJunio C Hamano <gitster@pobox.com>2008-01-10 01:08:11 -0800
commit95693d45ee1c1d4b76cac672636cf31229186a18 (patch)
tree84b1bec8ad8a2ab4c24cc6552b918d295c7de9f5 /bundle.c
parent35cda061640c26371d5841099ad30c6968d510b2 (diff)
downloadgit-95693d45ee1c1d4b76cac672636cf31229186a18.tar.gz
bundle, fast-import: detect write failure
I noticed some unchecked writes. This fixes them. * bundle.c (create_bundle): Die upon write failure. * fast-import.c (keep_pack): Die upon write or close failure. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.c')
-rw-r--r--bundle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundle.c b/bundle.c
index be204d8a22..316aa7420d 100644
--- a/bundle.c
+++ b/bundle.c
@@ -320,9 +320,9 @@ int create_bundle(struct bundle_header *header, const char *path,
for (i = 0; i < revs.pending.nr; i++) {
struct object *object = revs.pending.objects[i].item;
if (object->flags & UNINTERESTING)
- write(rls.in, "^", 1);
- write(rls.in, sha1_to_hex(object->sha1), 40);
- write(rls.in, "\n", 1);
+ write_or_die(rls.in, "^", 1);
+ write_or_die(rls.in, sha1_to_hex(object->sha1), 40);
+ write_or_die(rls.in, "\n", 1);
}
if (finish_command(&rls))
return error ("pack-objects died");