chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journal: implement parallel traversal in client
[elogind.git]
/
src
/
journal
/
journalctl.c
diff --git
a/src/journal/journalctl.c
b/src/journal/journalctl.c
index 838e8436e4d3d29353ec3c25f0230489d2fbc571..5f17f45cac9e4a96ad490b0f375e66828ac0616f 100644
(file)
--- a/
src/journal/journalctl.c
+++ b/
src/journal/journalctl.c
@@
-23,7
+23,7
@@
#include <errno.h>
#include <stddef.h>
#include <errno.h>
#include <stddef.h>
-#include "journal-
privat
e.h"
+#include "journal-
fil
e.h"
int main(int argc, char *argv[]) {
int r;
int main(int argc, char *argv[]) {
int r;
@@
-33,9
+33,9
@@
int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
log_parse_environment();
log_open();
- r = journal_file_open(
NULL,
"/var/log/journal/system.journal", O_RDONLY, 0644, &f);
+ r = journal_file_open("/var/log/journal/system.journal", O_RDONLY, 0644, &f);
if (r == -ENOENT)
if (r == -ENOENT)
- r = journal_file_open(
NULL,
"/run/log/journal/system.journal", O_RDONLY, 0644, &f);
+ r = journal_file_open("/run/log/journal/system.journal", O_RDONLY, 0644, &f);
if (r < 0) {
log_error("Failed to open journal: %s", strerror(-r));
if (r < 0) {
log_error("Failed to open journal: %s", strerror(-r));
@@
-62,21
+62,16
@@
int main(int argc, char *argv[]) {
uint64_t p, l;
p = le64toh(o->entry.items[i].object_offset);
uint64_t p, l;
p = le64toh(o->entry.items[i].object_offset);
- r = journal_file_move_to_object(f, p, &o);
+ r = journal_file_move_to_object(f, p,
OBJECT_DATA,
&o);
if (r < 0) {
log_error("Failed to move to data: %s", strerror(-r));
goto finish;
}
if (r < 0) {
log_error("Failed to move to data: %s", strerror(-r));
goto finish;
}
- if (le64toh(o->object.type) != OBJECT_DATA) {
- log_error("Invalid file");
- goto finish;
- }
-
l = o->object.size - offsetof(Object, data.payload);
printf("\t[%.*s]\n", (int) l, o->data.payload);
l = o->object.size - offsetof(Object, data.payload);
printf("\t[%.*s]\n", (int) l, o->data.payload);
- r = journal_file_move_to_object(f, offset, &o);
+ r = journal_file_move_to_object(f, offset,
OBJECT_ENTRY,
&o);
if (r < 0) {
log_error("Failed to move back to entry: %s", strerror(-r));
goto finish;
if (r < 0) {
log_error("Failed to move back to entry: %s", strerror(-r));
goto finish;