aboutsummaryrefslogtreecommitdiffstats
path: root/volumes.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2016-06-09 10:23:15 +0900
committerDavid Sterba <dsterba@suse.com>2016-07-13 18:44:52 +0200
commitdabd2835836cd77c765e3f500c349ffe126f458c (patch)
tree64238efb69801699f242c77838444b894bf5280d /volumes.c
parente67219255cca7b8e09789b6ca725fc4e9780da73 (diff)
downloadbtrfs-progs-dabd2835836cd77c765e3f500c349ffe126f458c.tar.gz
btrfs-progs-dabd2835836cd77c765e3f500c349ffe126f458c.tar.xz
btrfs-progs-dabd2835836cd77c765e3f500c349ffe126f458c.zip
btrfs-progs: add the error message when open fails
When open in btrfs_open_devices failed, only the following message is displayed. Therefore the user doesn't understand the reason why open failed. # btrfs check /dev/sdb8 Couldn't open file system This patch adds the error message when open fails. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/volumes.c b/volumes.c
index ccfa732..b42a412 100644
--- a/volumes.c
+++ b/volumes.c
@@ -227,6 +227,8 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags)
fd = open(device->name, flags);
if (fd < 0) {
ret = -errno;
+ error("cannot open device '%s': %s", device->name,
+ strerror(errno));
goto fail;
}