]> git.ipfire.org Git - thirdparty/systemd.git/commit
glob-util: rework safe_glob()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 22 Jun 2025 23:55:54 +0000 (08:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jun 2025 14:11:44 +0000 (23:11 +0900)
commit2a5f950e5643a74bef70b1c3c46ec33ad0e3fd41
tree96a1f8970ee203ea2281b9c8efd6dbbd1fb9116e
parent1b0c39458bab864f0279195c19513f15543cf1ee
glob-util: rework safe_glob()

Currently, callers of safe_glob() set an empty glob_t or glob_t with
opendir func, and all other components are always zero.
So, let's introduce safe_glob_full() which optionally takes opendir
function, rather than glob_t, and returns result strv, rather than
storing results in glob_t.
Also, introduce safe_glob() which is a trivial wrapper of
safe_glob_full() without opendir func.

No functional change, just refactoring.
src/basic/glob-util.c
src/basic/glob-util.h
src/core/exec-credential.c
src/core/execute.c
src/test/test-glob-util.c
src/tmpfiles/tmpfiles.c