summaryrefslogtreecommitdiff
path: root/src/basic/mount-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-02-15 09:43:02 +0900
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:59:01 +0200
commited7432290936ba913f52b11c79baedb57162c615 (patch)
treeff52845b9fef4e8c6f93b3e5615347cdfb76cc45 /src/basic/mount-util.c
parent2f42b0cdac62766e887eaad370cf9fad682c84b0 (diff)
mount-util: call mount_option_mangle() in mount_verbose()
Diffstat (limited to 'src/basic/mount-util.c')
-rw-r--r--src/basic/mount-util.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
index e7106898b..4c9b5adff 100644
--- a/src/basic/mount-util.c
+++ b/src/basic/mount-util.c
@@ -817,29 +817,37 @@ int mount_verbose(
unsigned long flags,
const char *options) {
- _cleanup_free_ char *fl = NULL;
+ _cleanup_free_ char *fl = NULL, *o = NULL;
+ unsigned long f;
+ int r;
+
+ r = mount_option_mangle(options, flags, &f, &o);
+ if (r < 0)
+ return log_full_errno(error_log_level, r,
+ "Failed to mangle mount options %s: %m",
+ strempty(options));
- fl = mount_flags_to_string(flags);
+ fl = mount_flags_to_string(f);
- if ((flags & MS_REMOUNT) && !what && !type)
+ if ((f & MS_REMOUNT) && !what && !type)
log_debug("Remounting %s (%s \"%s\")...",
- where, strnull(fl), strempty(options));
+ where, strnull(fl), strempty(o));
else if (!what && !type)
log_debug("Mounting %s (%s \"%s\")...",
- where, strnull(fl), strempty(options));
- else if ((flags & MS_BIND) && !type)
+ where, strnull(fl), strempty(o));
+ else if ((f & MS_BIND) && !type)
log_debug("Bind-mounting %s on %s (%s \"%s\")...",
- what, where, strnull(fl), strempty(options));
- else if (flags & MS_MOVE)
+ what, where, strnull(fl), strempty(o));
+ else if (f & MS_MOVE)
log_debug("Moving mount %s → %s (%s \"%s\")...",
- what, where, strnull(fl), strempty(options));
+ what, where, strnull(fl), strempty(o));
else
log_debug("Mounting %s on %s (%s \"%s\")...",
- strna(type), where, strnull(fl), strempty(options));
- if (mount(what, where, type, flags, options) < 0)
+ strna(type), where, strnull(fl), strempty(o));
+ if (mount(what, where, type, f, o) < 0)
return log_full_errno(error_log_level, errno,
"Failed to mount %s on %s (%s \"%s\"): %m",
- strna(type), where, strnull(fl), strempty(options));
+ strna(type), where, strnull(fl), strempty(o));
return 0;
}