chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: allow deletion of temporary files from normal fs
[elogind.git]
/
src
/
journal
/
test-journal.c
diff --git
a/src/journal/test-journal.c
b/src/journal/test-journal.c
index 39f4c167789d3cec08189e064b575b60696a71e4..ca3b4741f57ddfe675b68ad6395f80cf981724ee 100644
(file)
--- a/
src/journal/test-journal.c
+++ b/
src/journal/test-journal.c
@@
-34,12
+34,14
@@
int main(int argc, char *argv[]) {
static const char test[] = "test", test2[] = "test2";
Object *o;
uint64_t p;
static const char test[] = "test", test2[] = "test2";
Object *o;
uint64_t p;
+ char t[] = "/tmp/journal-XXXXXX";
log_set_max_level(LOG_DEBUG);
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);
+ assert_se(journal_file_open("test.journal", O_RDWR|O_CREAT, 0666, NULL,
NULL,
&f) == 0);
dual_timestamp_get(&ts);
dual_timestamp_get(&ts);
@@
-116,5
+118,7
@@
int main(int argc, char *argv[]) {
log_error("Exiting...");
log_error("Exiting...");
+ assert_se(rm_rf_dangerous(t, false, true, false) >= 0);
+
return 0;
}
return 0;
}