summaryrefslogtreecommitdiff
path: root/cmds-scrub.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-03-04 16:35:42 -0600
committerDavid Sterba <dsterba@suse.cz>2013-03-10 16:06:37 +0100
commit7b81119b1d3904cf00ec29140e8bc5d86a12902f (patch)
tree633ae107900b20289f4b06444136521f3aff72dd /cmds-scrub.c
parent06efd54588aa1d155e73f6f6372f44832154a279 (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-scrub.c')
-rw-r--r--cmds-scrub.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c
index da4120f8..6fcff8b4 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -287,7 +287,11 @@ static void free_history(struct scrub_file_record **last_scrubs)
static int cancel_fd = -1;
static void scrub_sigint_record_progress(int signal)
{
- ioctl(cancel_fd, BTRFS_IOC_SCRUB_CANCEL, NULL);
+ int ret;
+
+ ret = ioctl(cancel_fd, BTRFS_IOC_SCRUB_CANCEL, NULL);
+ if (ret < 0)
+ perror("Scrub cancel failed");
}
static int scrub_handle_sigint_parent(void)