diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-08 14:38:52 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-08 23:13:45 +0100 |
commit | 3c7560019e623e6e0d03a860b4f19a3a8715feca (patch) | |
tree | f467f1304bdb009913c12e73b5870cb853665f92 /src/shared | |
parent | 3a8d368a6184ca8b7422330b53513983088671f2 (diff) |
loginctl: show the 10 most recent log user/session log lines in "loginctl user-status" and "loginctl session-status"
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/logs-show.c | 8 | ||||
-rw-r--r-- | src/shared/logs-show.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index dff0d30d71..b7a99d2c23 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -1234,12 +1234,12 @@ int show_journal_by_unit( unsigned how_many, uid_t uid, OutputFlags flags, - bool system, + int journal_open_flags, + bool system_unit, bool *ellipsized) { _cleanup_journal_close_ sd_journal*j = NULL; int r; - int jflags = SD_JOURNAL_LOCAL_ONLY | system * SD_JOURNAL_SYSTEM; assert(mode >= 0); assert(mode < _OUTPUT_MODE_MAX); @@ -1248,7 +1248,7 @@ int show_journal_by_unit( if (how_many <= 0) return 0; - r = sd_journal_open(&j, jflags); + r = sd_journal_open(&j, journal_open_flags); if (r < 0) return r; @@ -1256,7 +1256,7 @@ int show_journal_by_unit( if (r < 0) return r; - if (system) + if (system_unit) r = add_matches_for_unit(j, unit); else r = add_matches_for_user_unit(j, unit, uid); diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h index 187ee595fb..8d9641e8ac 100644 --- a/src/shared/logs-show.h +++ b/src/shared/logs-show.h @@ -25,7 +25,7 @@ #include <unistd.h> #include <sys/types.h> -#include "systemd/sd-journal.h" +#include "sd-journal.h" #include "util.h" #include "output-mode.h" @@ -58,7 +58,8 @@ int show_journal_by_unit( unsigned how_many, uid_t uid, OutputFlags flags, - bool system, + int journal_open_flags, + bool system_unit, bool *ellipsized); void json_escape( |