summaryrefslogtreecommitdiff
path: root/src/mount
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-05-31 23:39:31 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-06-03 23:39:26 +0900
commit858d36c1ec7cd1173c60e8ab17b8425325253e38 (patch)
tree147284bf1b34c8917aa67bfdd2c15f672a0471af /src/mount
parentaff443013640ba783c89c9032ebd5a557f2fc11e (diff)
downloadsystemd-858d36c1ec7cd1173c60e8ab17b8425325253e38.tar.gz
path-util: introduce path_simplify()
The function is similar to path_kill_slashes() but also removes initial './', trailing '/.', and '/./' in the path. When the second argument of path_simplify() is false, then it behaves as the same as path_kill_slashes(). Hence, this also replaces path_kill_slashes() with path_simplify().
Diffstat (limited to 'src/mount')
-rw-r--r--src/mount/mount-tool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c
index 02989301fe..5e22a434f1 100644
--- a/src/mount/mount-tool.c
+++ b/src/mount/mount-tool.c
@@ -354,7 +354,7 @@ static int parse_argv(int argc, char *argv[]) {
if (!arg_mount_what)
return log_oom();
- path_kill_slashes(arg_mount_what);
+ path_simplify(arg_mount_what, false);
if (!path_is_absolute(arg_mount_what)) {
log_error("Only absolute path is supported: %s", arg_mount_what);
@@ -372,7 +372,7 @@ static int parse_argv(int argc, char *argv[]) {
if (!arg_mount_where)
return log_oom();
- path_kill_slashes(arg_mount_where);
+ path_simplify(arg_mount_where, false);
if (!path_is_absolute(arg_mount_where)) {
log_error("Only absolute path is supported: %s", arg_mount_where);
@@ -992,7 +992,7 @@ static int action_umount(
if (!p)
return log_oom();
- path_kill_slashes(p);
+ path_simplify(p, false);
r = stop_mounts(bus, p);
if (r < 0)