btrfs-progs: switch to common message helpers in open_ctree_fs_info

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-03-18 16:34:33 +01:00
parent c921544bba
commit 274b1d9121
1 changed files with 2 additions and 2 deletions

View File

@ -1334,7 +1334,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename,
return NULL; return NULL;
} }
if (!(((st.st_mode & S_IFMT) == S_IFREG) || ((st.st_mode & S_IFMT) == S_IFBLK))) { 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; return NULL;
} }
@ -1343,7 +1343,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename,
fp = open(filename, oflags, 0600); fp = open(filename, oflags, 0600);
if (fp < 0) { if (fp < 0) {
fprintf (stderr, "Could not open %s\n", filename); error("cannot open '%s': %s", filename, strerror(errno));
return NULL; return NULL;
} }
info = __open_ctree_fd(fp, filename, sb_bytenr, root_tree_bytenr, info = __open_ctree_fd(fp, filename, sb_bytenr, root_tree_bytenr,