summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-15 01:13:37 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-15 01:13:37 +0200
commitde7b95cdc3228131498021c2fdcf6647004c3920 (patch)
treeb5b240c888986f21a3b102ddf577d3d67285b549 /src/journal/journalctl.c
parent1cc101f1e59ca2f5e87dea48ac9ed98c6f077b3b (diff)
journal: properly implement matching with multiple matches
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index a6b6e0fbd6..3475b9d43c 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -31,7 +31,7 @@
#include "log.h"
int main(int argc, char *argv[]) {
- int r;
+ int r, i;
sd_journal *j = NULL;
log_set_max_level(LOG_DEBUG);
@@ -46,6 +46,14 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ for (i = 1; i < argc; i++) {
+ r = sd_journal_add_match(j, argv[i], strlen(argv[i]));
+ if (r < 0) {
+ log_error("Failed to add match: %s", strerror(-r));
+ goto finish;
+ }
+ }
+
SD_JOURNAL_FOREACH(j) {
const void *data;
size_t length;