aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-receive.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-12 13:35:50 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:55 +0100
commitac4ec4d4f44e67fc3d1fd806cf7acbe2485cedee (patch)
tree434f39155069a914bc76d3e9fdca87a331012b7a /cmds-receive.c
parent633dc6f80f201afdf5b8524ae377187d58f0ef3b (diff)
downloadbtrfs-progs-ac4ec4d4f44e67fc3d1fd806cf7acbe2485cedee.tar.gz
btrfs-progs-ac4ec4d4f44e67fc3d1fd806cf7acbe2485cedee.tar.xz
btrfs-progs-ac4ec4d4f44e67fc3d1fd806cf7acbe2485cedee.zip
btrfs-progs: check for negative return value from ioctl
Handle only negative values returned by ioctl syscalls, with exception of the device remove. It returns positive values that are handled later. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r--cmds-receive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index 6d50cd3..094a607 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -771,7 +771,7 @@ static int process_clone(const char *path, u64 offset, u64 len,
clone_args.src_length = len;
clone_args.dest_offset = offset;
ret = ioctl(r->write_fd, BTRFS_IOC_CLONE_RANGE, &clone_args);
- if (ret) {
+ if (ret < 0) {
ret = -errno;
error("failed to clone extents to %s\n%s\n",
path, strerror(-ret));