summaryrefslogtreecommitdiff
path: root/bulk-checkin.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2013-08-20 11:15:26 +0200
committerJunio C Hamano <gitster@pobox.com>2013-08-20 11:20:53 -0700
commite92527c97cfa26bf6e42381cf1b7035950c36e69 (patch)
treee35061802f74e6647f93d1d20e093b9bbbd27448 /bulk-checkin.c
parent15999998fbda60552742275570947431b57108ae (diff)
downloadgit-e92527c97cfa26bf6e42381cf1b7035950c36e69.tar.gz
stream_to_pack: xread does not guarantee to read all requested bytesjs/xread-in-full
The deflate loop in bulk-checkin::stream_to_pack expects to get all bytes from a file that it requests to read in a single function call. But it used xread(), which does not give that guarantee. Replace it by read_in_full(). Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bulk-checkin.c')
-rw-r--r--bulk-checkin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bulk-checkin.c b/bulk-checkin.c
index 6b0b6d4904..118c62528b 100644
--- a/bulk-checkin.c
+++ b/bulk-checkin.c
@@ -114,7 +114,7 @@ static int stream_to_pack(struct bulk_checkin_state *state,
if (size && !s.avail_in) {
ssize_t rsize = size < sizeof(ibuf) ? size : sizeof(ibuf);
- if (xread(fd, ibuf, rsize) != rsize)
+ if (read_in_full(fd, ibuf, rsize) != rsize)
die("failed to read %d bytes from '%s'",
(int)rsize, path);
offset += rsize;