btrfs-progs: send-stream: pass char buffer to read_buf

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-11-15 14:26:44 +01:00
parent 194666a672
commit d63854d1b6

View File

@ -37,13 +37,13 @@ struct btrfs_send_stream {
void *user;
};
static int read_buf(struct btrfs_send_stream *sctx, void *buf, size_t len)
static int read_buf(struct btrfs_send_stream *sctx, char *buf, size_t len)
{
int ret;
size_t pos = 0;
while (pos < len) {
ret = read(sctx->fd, (char*)buf + pos, len - pos);
ret = read(sctx->fd, buf + pos, len - pos);
if (ret < 0) {
ret = -errno;
error("read from stream failed: %s",
@ -452,7 +452,7 @@ int btrfs_read_and_process_send_stream(int fd,
sctx.ops = ops;
sctx.user = user;
ret = read_buf(&sctx, &hdr, sizeof(hdr));
ret = read_buf(&sctx, (char*)&hdr, sizeof(hdr));
if (ret < 0)
goto out;
if (ret) {