summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index d8c3dcc9..2a15d866 100644
--- a/utils.c
+++ b/utils.c
@@ -821,6 +821,7 @@ void btrfs_register_one_device(char *fname)
struct btrfs_ioctl_vol_args args;
int fd;
int ret;
+ int e;
fd = open("/dev/btrfs-control", O_RDONLY);
if (fd < 0) {
@@ -830,6 +831,11 @@ void btrfs_register_one_device(char *fname)
}
strncpy(args.name, fname, BTRFS_PATH_NAME_MAX);
ret = ioctl(fd, BTRFS_IOC_SCAN_DEV, &args);
+ e = errno;
+ if(ret<0){
+ fprintf(stderr, "ERROR: unable to scan the device '%s' - %s\n",
+ fname, strerror(e));
+ }
close(fd);
}