summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/journal/test-journal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/test-journal.c b/src/journal/test-journal.c
index 39f4c16778..9e1a4f57ba 100644
--- a/src/journal/test-journal.c
+++ b/src/journal/test-journal.c
@@ -34,10 +34,12 @@ int main(int argc, char *argv[]) {
static const char test[] = "test", test2[] = "test2";
Object *o;
uint64_t p;
+ char t[] = "/tmp/journal-XXXXXX";
log_set_max_level(LOG_DEBUG);
- unlink("test.journal");
+ assert_se(mkdtemp(t));
+ assert_se(chdir(t) >= 0);
assert_se(journal_file_open("test.journal", O_RDWR|O_CREAT, 0666, NULL, &f) == 0);
@@ -116,5 +118,7 @@ int main(int argc, char *argv[]) {
log_error("Exiting...");
+ assert_se(rm_rf(t, false, true, false) >= 0);
+
return 0;
}