summaryrefslogtreecommitdiffstats
path: root/src/machine
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-01 23:19:31 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-07 18:38:41 +0100
commit676bcb0fc042c24e4335832622ea4104a1295b48 (patch)
tree21f04994c40f12328d35db1214325169a91da467 /src/machine
parentnspawn: port nspawn to new generalized image dissection code (diff)
downloadsystemd-676bcb0fc042c24e4335832622ea4104a1295b48.tar.xz
systemd-676bcb0fc042c24e4335832622ea4104a1295b48.zip
util-lib: add easy helpers for temporary directories that rmdir()ed via _cleanup_
This adds mkdtemp_malloc() that is a combination of mkdtemp() plus strdup(). It initializes its return paremeter only if the temporary directory could be created successfully, so that the parameter is exactly non-NULL when the directory exists. rmdir_and_free() and rmdir_and_freep() are also added, and the latter may be used inside of _cleanup_ for such a directory string variable, to automatically rmdir() the directory if it is non-NULL when the scope exits. rmdir_and_free() is similar to the existing rm_rf_and_free() however, is only removes a single directory and does not operate recursively.
Diffstat (limited to 'src/machine')
0 files changed, 0 insertions, 0 deletions