summaryrefslogtreecommitdiffstats
path: root/src/test/test-acl-util.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-04-21 16:25:31 +0200
committerDavid Tardon <dtardon@redhat.com>2023-04-21 16:44:05 +0200
commit596b44b178757b72975e7d577896f29b71c731ff (patch)
tree58fd7a89f5cc78a08437108252cdeac5a0a3608b /src/test/test-acl-util.c
parenttest-fdset: use _cleanup_ (diff)
downloadsystemd-596b44b178757b72975e7d577896f29b71c731ff.tar.xz
systemd-596b44b178757b72975e7d577896f29b71c731ff.zip
test: use _cleanup_ for temp. files
Diffstat (limited to 'src/test/test-acl-util.c')
-rw-r--r--src/test/test-acl-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-acl-util.c b/src/test/test-acl-util.c
index 2c406893df..093eaaa01b 100644
--- a/src/test/test-acl-util.c
+++ b/src/test/test-acl-util.c
@@ -9,13 +9,14 @@
#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
+#include "fs-util.h"
#include "string-util.h"
#include "tests.h"
#include "tmpfile-util.h"
#include "user-util.h"
TEST_RET(add_acls_for_user) {
- char fn[] = "/tmp/test-empty.XXXXXX";
+ _cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-empty.XXXXXX";
_cleanup_close_ int fd = -EBADF;
char *cmd;
uid_t uid;
@@ -65,7 +66,6 @@ TEST_RET(add_acls_for_user) {
cmd = strjoina("getfacl -p ", fn);
assert_se(system(cmd) == 0);
- (void) unlink(fn);
return 0;
}