]> git.ipfire.org Git - thirdparty/systemd.git/commit
tmpfiles: use fd_get_path() even less excessively
authorFranck Bui <fbui@suse.com>
Mon, 20 Aug 2018 15:23:12 +0000 (17:23 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Aug 2018 17:48:08 +0000 (19:48 +0200)
commit4dc7bfdf4f054c291ffb317963e8f8256fe2833b
tree8624901ded6659ad7ba64166779cf1f85ae11525
parent05666680160694bb85f34e1607ba8c9fb1723141
tmpfiles: use fd_get_path() even less excessively

A follow-up for commit 9d874aec451b591401d9b14cf8743b9d179159b2.

This patch makes "path" parameter mandatory in fd_set_*() helpers removing the
need to use fd_get_path() when NULL was passed. The caller is supposed to pass
the fd anyway so assuming that it also knows the path should be safe.

Actually, the only case where this was useful (or used) was when we were
walking through directory trees (in item_do()). But even in those cases the
paths could be constructed trivially, which is still better than relying on
fd_get_path() (which is an ugly API).

A very succinct test case is also added for 'z/Z' operators so the code dealing
with recursive operators is tested minimally.
src/tmpfiles/tmpfiles.c
test/TEST-22-TMPFILES/test-05.sh [new file with mode: 0755]