]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: add path_simplify_alloc() and use it
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2023 15:38:17 +0000 (17:38 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 22 Sep 2023 06:13:34 +0000 (08:13 +0200)
commit660087dc9c4a5c610da99e7b6b1772e371eb0a80
tree30c430acb6cb10d05837c89b533ade607116bfb3
parent7902df12638943be7d3ee935e9837ced3c282eab
tree-wide: add path_simplify_alloc() and use it

path_simplify_full()/path_simplify() are changed to allow a NULL path, for
which a NULL is returned. Generally, callers have already asserted before that
the argument is nonnull. This way path_simplify_full()/path_simplify() and
path_simplify_alloc() behave consistently.

In sd-device.c, logging in device_set_syspath() is intentionally dropped: other
branches don't log.

In mount-tool.c, logging in parse_argv() is changed to log the user-specified
value, not the simplified string. In an error message, we should show the
actual argument we got, not some transformed version.
13 files changed:
src/basic/cgroup-util.c
src/basic/fileio.c
src/basic/path-util.c
src/basic/path-util.h
src/basic/unit-name.c
src/basic/user-util.c
src/core/dbus-path.c
src/core/dbus-socket.c
src/libsystemd/sd-device/sd-device.c
src/mount/mount-tool.c
src/portable/portable.c
src/shared/install.c
src/udev/udev-node.c