diff options
author | David Sterba <dsterba@suse.com> | 2016-01-12 13:35:50 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-01-12 15:02:55 +0100 |
commit | ac4ec4d4f44e67fc3d1fd806cf7acbe2485cedee (patch) | |
tree | 434f39155069a914bc76d3e9fdca87a331012b7a /cmds-send.c | |
parent | 633dc6f80f201afdf5b8524ae377187d58f0ef3b (diff) |
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-send.c')
-rw-r--r-- | cmds-send.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-send.c b/cmds-send.c index 0dd493aa..478ace1f 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -293,7 +293,7 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id, if (!is_last_subvol) io_send.flags |= BTRFS_SEND_FLAG_OMIT_END_CMD; ret = ioctl(subvol_fd, BTRFS_IOC_SEND, &io_send); - if (ret) { + if (ret < 0) { ret = -errno; error("send ioctl failed with %d: %s", ret, strerror(-ret)); if (ret == -EINVAL && (!is_first_subvol || !is_last_subvol)) |