]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: always show the user-provided argument when umount can't be done 6768/head
authorFelipe Sateler <fsateler@gmail.com>
Thu, 7 Sep 2017 19:16:19 +0000 (16:16 -0300)
committerFelipe Sateler <fsateler@gmail.com>
Thu, 7 Sep 2017 19:16:47 +0000 (16:16 -0300)
Otherwise it can be confusing if the path is not the same

src/mount/mount-tool.c

index 2e282ef04ef9b57bf6df711fb8f96ebfaa450e8f..64438cd6d739871fe583d5e1083450a94c8cb4d3 100644 (file)
@@ -998,7 +998,7 @@ static int action_umount(
 
                 r = path_make_absolute_cwd(u, &a);
                 if (r < 0) {
-                        r2 = log_error_errno(r, "Failed to make path absolute: %m");
+                        r2 = log_error_errno(r, "Failed to make path %s absolute: %m", argv[i]);
                         continue;
                 }
 
@@ -1010,7 +1010,7 @@ static int action_umount(
                 }
 
                 if (stat(p, &st) < 0)
-                        return log_error_errno(errno, "Can't stat %s: %m", p);
+                        return log_error_errno(errno, "Can't stat %s (from %s): %m", p, argv[i]);
 
                 if (S_ISBLK(st.st_mode))
                         r = umount_by_device(bus, p);
@@ -1019,7 +1019,7 @@ static int action_umount(
                 else if (S_ISDIR(st.st_mode))
                         r = stop_mounts(bus, p);
                 else {
-                        log_error("Invalid file type: %s", p);
+                        log_error("Invalid file type: %s (from %s)", p, argv[i]);
                         r = -EINVAL;
                 }