btrfs-progs: select-super: use message helpers for error messages

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-09-19 12:17:19 +02:00
parent b959a9a16b
commit 3f65090ba9

View File

@ -54,8 +54,7 @@ int main(int argc, char **argv)
case 's': case 's':
num = arg_strtou64(optarg); num = arg_strtou64(optarg);
if (num >= BTRFS_SUPER_MIRROR_MAX) { if (num >= BTRFS_SUPER_MIRROR_MAX) {
fprintf(stderr, error("super mirror should be less than: %d",
"ERROR: super mirror should be less than: %d\n",
BTRFS_SUPER_MIRROR_MAX); BTRFS_SUPER_MIRROR_MAX);
exit(1); exit(1);
} }
@ -70,7 +69,7 @@ int main(int argc, char **argv)
return 1; return 1;
if (bytenr == 0) { if (bytenr == 0) {
fprintf(stderr, "Please select the super copy with -s\n"); error("please select the super copy with -s");
print_usage(); print_usage();
} }
@ -88,7 +87,7 @@ int main(int argc, char **argv)
root = open_ctree(argv[optind], bytenr, 1); root = open_ctree(argv[optind], bytenr, 1);
if (!root) { if (!root) {
fprintf(stderr, "Open ctree failed\n"); error("open ctree failed");
return 1; return 1;
} }