]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/mount/mount-tool.c
mount: do not output (null) in option
[thirdparty/systemd.git] / src / mount / mount-tool.c
index 02989301fe5f72f2b1026d8bbe78c55d083a2f11..64c1efdb1cff9eb3209eeabaff5452b465df5edc 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2016 Lennart Poettering
-***/
 
 #include <getopt.h>
 
@@ -354,7 +349,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 +367,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);
@@ -454,7 +449,7 @@ static int transient_mount_set_properties(sd_bus_message *m) {
                 r = asprintf(&options,
                              "uid=" UID_FMT ",gid=" GID_FMT "%s%s",
                              arg_uid, arg_gid,
-                             arg_mount_options ? "," : "", arg_mount_options);
+                             arg_mount_options ? "," : "", strempty(arg_mount_options));
                 if (r < 0)
                         return -ENOMEM;
         }
@@ -992,7 +987,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)