From 274b1d912114db739e41af2960175f5e6a14463b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 18 Mar 2016 16:34:33 +0100 Subject: [PATCH] btrfs-progs: switch to common message helpers in open_ctree_fs_info Signed-off-by: David Sterba --- disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disk-io.c b/disk-io.c index c46f3662..4302e80f 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1334,7 +1334,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename, return NULL; } if (!(((st.st_mode & S_IFMT) == S_IFREG) || ((st.st_mode & S_IFMT) == S_IFBLK))) { - fprintf (stderr, "%s is not a regular file or block device\n", filename); + error("not a regular file or block device: %s", filename); return NULL; } @@ -1343,7 +1343,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename, fp = open(filename, oflags, 0600); if (fp < 0) { - fprintf (stderr, "Could not open %s\n", filename); + error("cannot open '%s': %s", filename, strerror(errno)); return NULL; } info = __open_ctree_fd(fp, filename, sb_bytenr, root_tree_bytenr,