forked from Mirrors/btrfs-progs
btrfs-progs: device scan: update error messages
Use the errno an %m pattern, update wording. Signed-off-by: David Sterba <dsterba@suse.com>master
parent
cec1472792
commit
aa4e8cbba2
|
@ -334,15 +334,17 @@ static int cmd_device_scan(int argc, char **argv)
|
||||||
if (all || argc - optind == 0) {
|
if (all || argc - optind == 0) {
|
||||||
if (forget) {
|
if (forget) {
|
||||||
ret = btrfs_forget_devices(NULL);
|
ret = btrfs_forget_devices(NULL);
|
||||||
error_on(ret, "'%s', forget failed",
|
if (ret < 0) {
|
||||||
strerror(-ret));
|
errno = -ret;
|
||||||
|
error("cannot unregister devices: %m");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Scanning for Btrfs filesystems\n");
|
printf("Scanning for Btrfs filesystems\n");
|
||||||
ret = btrfs_scan_devices();
|
ret = btrfs_scan_devices();
|
||||||
error_on(ret, "error %d while scanning", ret);
|
error_on(ret, "error %d while scanning", ret);
|
||||||
ret = btrfs_register_all_devices();
|
ret = btrfs_register_all_devices();
|
||||||
error_on(ret,
|
error_on(ret,
|
||||||
"there are %d errors while registering devices",
|
"there were %d errors while registering devices",
|
||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -364,12 +366,12 @@ static int cmd_device_scan(int argc, char **argv)
|
||||||
}
|
}
|
||||||
if (forget) {
|
if (forget) {
|
||||||
ret = btrfs_forget_devices(path);
|
ret = btrfs_forget_devices(path);
|
||||||
if (ret)
|
if (ret < 0) {
|
||||||
error("Can't forget '%s': %s",
|
errno = -ret;
|
||||||
path, strerror(-ret));
|
error("cannot unregister device '%s': %m", path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Scanning for Btrfs filesystems in '%s'\n",
|
printf("Scanning for btrfs filesystems on '%s'\n", path);
|
||||||
path);
|
|
||||||
if (btrfs_register_one_device(path) != 0) {
|
if (btrfs_register_one_device(path) != 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
free(path);
|
free(path);
|
||||||
|
|
Loading…
Reference in New Issue