summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-03 18:28:12 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-04 09:59:06 -0400
commit5ec76417764e19486261fb8e38e8e71b28185b37 (patch)
tree23711ec8f62b1d253eba848160bdce45b3a672d9 /src/journal/journalctl.c
parent7c1b8f043ed3d23663549dd6084c5a4de51b8e28 (diff)
systemctl: limit logs in status to current boot
Also reworded a few debug messages for brevity, and added a log statement which prints out the filter at debug level: Journal filter: (((UNIT=sys-module-configfs.device AND _PID=1) OR (COREDUMP_UNIT=sys-module-configfs.device AND MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1) OR _SYSTEMD_UNIT=sys-module-configfs.device) AND _BOOT_ID=4e3c518ab0474c12ac8de7896fe6b154)
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 2e672fa096..eb79c4d853 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -591,33 +591,10 @@ static int add_matches(sd_journal *j, char **args) {
}
static int add_this_boot(sd_journal *j) {
- char match[9+32+1] = "_BOOT_ID=";
- sd_id128_t boot_id;
- int r;
-
- assert(j);
-
if (!arg_this_boot)
return 0;
- r = sd_id128_get_boot(&boot_id);
- if (r < 0) {
- log_error("Failed to get boot id: %s", strerror(-r));
- return r;
- }
-
- sd_id128_to_string(boot_id, match + 9);
- r = sd_journal_add_match(j, match, strlen(match));
- if (r < 0) {
- log_error("Failed to add match: %s", strerror(-r));
- return r;
- }
-
- r = sd_journal_add_conjunction(j);
- if (r < 0)
- return r;
-
- return 0;
+ return add_match_this_boot(j);
}
static int add_dmesg(sd_journal *j) {