aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-11 14:59:46 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-11 14:59:46 -0700
commit0a3bc7d298408951630bbc6ac8e773659f900943 (patch)
treef75c7793a0df5b526f50c715637657fdae304333
parent42e5fb2bf1cc6e805c703a921aeb804993283320 (diff)
parente92527c97cfa26bf6e42381cf1b7035950c36e69 (diff)
downloadgit-0a3bc7d298408951630bbc6ac8e773659f900943.tar.gz
git-0a3bc7d298408951630bbc6ac8e773659f900943.tar.xz
Merge branch 'js/xread-in-full'
A call to xread() was used without a loop around to cope with short read in the codepath to stream new contents to a pack. * js/xread-in-full: stream_to_pack: xread does not guarantee to read all requested bytes
-rw-r--r--bulk-checkin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bulk-checkin.c b/bulk-checkin.c
index 6b0b6d490..118c62528 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;