diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-03-04 16:35:42 -0600 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-03-10 16:06:37 +0100 |
commit | 7b81119b1d3904cf00ec29140e8bc5d86a12902f (patch) | |
tree | 633ae107900b20289f4b06444136521f3aff72dd /cmds-replace.c | |
parent | 06efd54588aa1d155e73f6f6372f44832154a279 (diff) |
btrfs-progs: Issue warnings if ioctls fail in sigint handlers
The two sigint handlers issue ioctls to clean up, but if
they fail, noone would know. I'm not sure there is
any other error handling to be done at this point, but a
notification seems wise.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Diffstat (limited to 'cmds-replace.c')
-rw-r--r-- | cmds-replace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds-replace.c b/cmds-replace.c index 4cc32df2..10030f64 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -77,10 +77,13 @@ static int is_numerical(const char *str) static int dev_replace_cancel_fd = -1; static void dev_replace_sigint_handler(int signal) { + int ret; struct btrfs_ioctl_dev_replace_args args = {0}; args.cmd = BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL; - ioctl(dev_replace_cancel_fd, BTRFS_IOC_DEV_REPLACE, &args); + ret = ioctl(dev_replace_cancel_fd, BTRFS_IOC_DEV_REPLACE, &args); + if (ret < 0) + perror("Device replace cancel failed"); } static int dev_replace_handle_sigint(int fd) |