summaryrefslogtreecommitdiff
path: root/src/journal/test-journal-stream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-25 00:31:24 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-25 15:24:46 +0200
commit5d1ce25728856956c1fbfe05b491067f83bd2216 (patch)
tree0de24ab98c3a7cef94a2c0a68f1d5b33246d0266 /src/journal/test-journal-stream.c
parentcb306f5d500b6cf8e4367a847aa96ff764ad3aff (diff)
sd-journal: add API for opening journal files or directories by fd
Also, expose this via the "journalctl --file=-" syntax for STDIN. This feature remains undocumented though, as it is probably not too useful in real-life as this still requires fds that support mmaping and seeking, i.e. does not work for pipes, for which reading from STDIN is most commonly used.
Diffstat (limited to 'src/journal/test-journal-stream.c')
-rw-r--r--src/journal/test-journal-stream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c
index 839ea5a9a5..7e5a980719 100644
--- a/src/journal/test-journal-stream.c
+++ b/src/journal/test-journal-stream.c
@@ -92,9 +92,9 @@ int main(int argc, char *argv[]) {
assert_se(mkdtemp(t));
assert_se(chdir(t) >= 0);
- assert_se(journal_file_open("one.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &one) == 0);
- assert_se(journal_file_open("two.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &two) == 0);
- assert_se(journal_file_open("three.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &three) == 0);
+ assert_se(journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &one) == 0);
+ assert_se(journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &two) == 0);
+ assert_se(journal_file_open(-1, "three.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &three) == 0);
for (i = 0; i < N_ENTRIES; i++) {
char *p, *q;