block: print mountpoint if already mounted
authorDaniel Golle <daniel@makrotopia.org>
Thu, 21 Jul 2016 02:04:34 +0000 (04:04 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 21 Jul 2016 02:13:05 +0000 (04:13 +0200)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
block.c

diff --git a/block.c b/block.c
index 58487a1a1935e0fe65f2c62e18e73b901feff294..e674521cd1b70016674a5d4ed685c8916c7ace9d 100644 (file)
--- a/block.c
+++ b/block.c
@@ -727,6 +727,7 @@ static int mount_device(struct blkid_struct_probe *pr, int hotplug)
 {
        struct mount *m;
        char *device;
+       char *mp;
 
        if (!pr)
                return -1;
@@ -746,8 +747,9 @@ static int mount_device(struct blkid_struct_probe *pr, int hotplug)
        if (hotplug && !auto_mount)
                return -1;
 
-       if (find_mount_point(pr->dev)) {
-               ULOG_ERR("%s is already mounted\n", pr->dev);
+       mp = find_mount_point(pr->dev);
+       if (mp) {
+               ULOG_ERR("%s is already mounted on %s\n", pr->dev, mp);
                return -1;
        }