Skip to content

Commit

Permalink
Merge branch 'js/xread-in-full' into maint
Browse files Browse the repository at this point in the history
* js/xread-in-full:
  stream_to_pack: xread does not guarantee to read all requested bytes
  • Loading branch information
Jonathan Nieder committed Sep 26, 2013
2 parents 31d757d + e92527c commit be5e850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bulk-checkin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit be5e850

Please sign in to comment.