]> git.hungrycats.org Git - btrfs-progs/commitdiff
btrfs-progs: receive: use correct type for pwrite in process_write()
authorDavid Sterba <dsterba@suse.com>
Thu, 23 Jul 2026 10:14:08 +0000 (12:14 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Aug 2026 10:59:15 +0000 (12:59 +0200)
pwrite() return value will fit 'int' most of the time, but we should use
the correct type for consistency.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds/receive.c

index 68b6b6e053d0657510a2a14fe826c3e468dbdefa..49103ea3eeea20cbb556fa907e6a41d13c66cb5a 100644 (file)
@@ -699,7 +699,6 @@ static int process_write(const char *path, const void *data, u64 offset,
        struct btrfs_receive *rctx = user;
        char full_path[PATH_MAX];
        u64 pos = 0;
-       int w;
 
        ret = path_cat_out(full_path, rctx->full_subvol_path, path);
        if (ret < 0) {
@@ -716,6 +715,8 @@ static int process_write(const char *path, const void *data, u64 offset,
                        path, offset, len);
 
        while (pos < len) {
+               ssize_t w;
+
                w = pwrite(rctx->write_fd, (char*)data + pos, len - pos,
                                offset + pos);
                if (w == 0) {