From d63854d1b617a9206efaa2d8a60669bea9c16737 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 15 Nov 2016 14:26:44 +0100 Subject: btrfs-progs: send-stream: pass char buffer to read_buf Signed-off-by: David Sterba --- send-stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'send-stream.c') diff --git a/send-stream.c b/send-stream.c index 7b64dc22..502e43ec 100644 --- a/send-stream.c +++ b/send-stream.c @@ -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) { -- cgit v1.2.3