diff options
author | David Sterba <dsterba@suse.com> | 2016-10-28 18:34:03 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:13:52 +0100 |
commit | 365c2de3bc472850f19efad670c1872636c4dae1 (patch) | |
tree | 7bf7ab73f889e3dd857db0c7264d0fc3b3de9a7b | |
parent | 6d4fb3dcc13fdd3e04917bc656c8926116d13e44 (diff) |
btrfs-progs: convert: switch more messages to common helpers
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | btrfs-convert.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c index 2bcc16cd..4b9e2557 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -1505,7 +1505,7 @@ static int ext2_open_fs(struct btrfs_convert_context *cctx, const char *name) if (!(ext2_fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_FILETYPE)) { - fprintf(stderr, "filetype feature is missing\n"); + error("filetype feature is missing"); goto fail; } @@ -2371,7 +2371,7 @@ static int convert_open_fs(const char *devname, } } - fprintf(stderr, "No file system found to convert.\n"); + error("no file system found to convert"); return -1; } @@ -3103,8 +3103,8 @@ int main(int argc, char *argv[]) case 'l': copylabel = -1; if (strlen(optarg) >= BTRFS_LABEL_SIZE) { - fprintf(stderr, - "WARNING: label too long, trimmed to %d bytes\n", + warning( + "label too long, trimmed to %d bytes", BTRFS_LABEL_SIZE - 1); } __strncpy_null(fslabel, optarg, BTRFS_LABEL_SIZE - 1); @@ -3121,8 +3121,7 @@ int main(int argc, char *argv[]) tmp = btrfs_parse_fs_features(tmp, &features); if (tmp) { - fprintf(stderr, - "Unrecognized filesystem feature '%s'\n", + error("unrecognized filesystem feature: %s", tmp); free(orig); exit(1); @@ -3138,8 +3137,7 @@ int main(int argc, char *argv[]) btrfs_parse_features_to_string(buf, features & ~BTRFS_CONVERT_ALLOWED_FEATURES); - fprintf(stderr, - "ERROR: features not allowed for convert: %s\n", + error("features not allowed for convert: %s", buf); exit(1); } @@ -3175,11 +3173,10 @@ int main(int argc, char *argv[]) file = argv[optind]; ret = check_mounted(file); if (ret < 0) { - fprintf(stderr, "Could not check mount status: %s\n", - strerror(-ret)); + error("could not check mount status: %s", strerror(-ret)); return 1; } else if (ret) { - fprintf(stderr, "%s is mounted\n", file); + error("%s is mounted", file); return 1; } |