summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-16 11:35:41 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit2d8a35e2eb9b93aafe0a86e45bb4cb0abf8b6c3a (patch)
treee422245cb8087a86ef9566f588e33c64f3305eba /src/test
parent128beb102e3f081742727ca685ca67d68cd382dd (diff)
fs-util,test: add helper to remove tempfiles
This simplifies the use of tempfiles in tests and fixes "leaked" temporary files in test-fileio, test-catalog, test-conf-parser. Not the whole tree is converted.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-conf-parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index 76419a74b..85954e097 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -8,6 +8,7 @@
#include "conf-parser.h"
#include "fd-util.h"
#include "fileio.h"
+//#include "fs-util.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
@@ -329,7 +330,7 @@ static const char* const config_file[] = {
};
static void test_config_parse(unsigned i, const char *s) {
- char name[] = "/tmp/test-conf-parser.XXXXXX";
+ _cleanup_(unlink_tempfilep) char name[] = "/tmp/test-conf-parser.XXXXXX";
int fd, r;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ char *setting1 = NULL;