journalctl.c revision 730836403aee5f5bb998e6e3622ea7068fce0699
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen This file is part of systemd.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Copyright 2011 Lennart Poettering
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen systemd is free software; you can redistribute it and/or modify it
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen under the terms of the GNU Lesser General Public License as published by
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen (at your option) any later version.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen systemd is distributed in the hope that it will be useful, but
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Lesser General Public License for more details.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen You should have received a copy of the GNU Lesser General Public License
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering#define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poetteringstatic OutputMode arg_output = OUTPUT_SHORT;
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersenstatic bool arg_pager_end = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_follow = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_full = true;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_all = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_no_pager = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_no_tail = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_quiet = false;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenstatic bool arg_merge = false;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautastatic bool arg_boot = false;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautastatic bool arg_dmesg = false;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautastatic bool arg_show_cursor = false;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstatic usec_t arg_interval = DEFAULT_FSS_INTERVAL_USEC;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstatic bool arg_force = false;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstatic bool arg_since_set = false, arg_until_set = false;
edb85f0d8d0a84f27308a3728f3fde3c52b9dce2Susant Sahanistatic bool arg_catalog = false;
2cc412b59353576cece2d5b30c6a39c70552f0a0Tom Gundersenstatic bool arg_reverse = false;
e1ea665edac17d75fce01b72dadfa3211b60df2cEugene Yakubovichtypedef struct boot_id_t {
dd43110f781a9245ec00531456fee68ed763a179Tom Gundersenstatic void pager_open_if_enabled(void) {
c106cc36b9b8e8998eb95299b02f1db9c1209122Tom Gundersenstatic int parse_boot_descriptor(const char *x, sd_id128_t *boot_id, int *offset) {
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen if (*x != 0) {
fd6d906cf46ecef45ebbb5a361e1dc436f031d7aLennart Poetteringstatic void help(void) {
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen "Query the journal.\n\n"
16aa63a00b5b1db23a9c0b8de350ebf482d90cd0Tom Gundersen " --system Show the system journal\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --user Show the user journal for the current user\n"
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering " -M --machine=CONTAINER Operate on local container\n"
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen " --since=DATE Start showing entries on or newer than the specified date\n"
9e7e440835c43d81ffdbc299d2c07daaa641ed50Tom Gundersen " --until=DATE Stop showing entries on or older than the specified date\n"
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog " -c --cursor=CURSOR Start showing entries from the specified cursor\n"
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog " --after-cursor=CURSOR Start showing entries from after the specified cursor\n"
28cc555d8504c9429776aedbbe1fee7101258578Dan Williams " --show-cursor Print the cursor after all the entries\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " -b --boot[=ID] Show data only from ID or, if unspecified, the current boot\n"
5d3de3fe9cc452f1bfe3c2dcafecbd7f904da4dcLennart Poettering " --list-boots Show terse information about recorded boots\n"
5d3de3fe9cc452f1bfe3c2dcafecbd7f904da4dcLennart Poettering " -k --dmesg Show kernel message log from the current boot\n"
9e7e440835c43d81ffdbc299d2c07daaa641ed50Tom Gundersen " -u --unit=UNIT Show data only from the specified unit\n"
46b0c76e2c355c0d0cc4792abb98cde07b28bc53Emil Renner Berthing " --user-unit=UNIT Show data only from the specified user session unit\n"
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen " -t --identifier=STRING Show only messages with the specified syslog identifier\n"
3d3d425547a3f38473fcf8737b85dfebb630479dTom Gundersen " -p --priority=RANGE Show only messages within the specified priority range\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " -e --pager-end Immediately jump to end of the journal in the pager\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " -f --follow Follow the journal\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " -n --lines[=INTEGER] Number of journal entries to show\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " --no-tail Show all lines, even in follow mode\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " -r --reverse Show the newest entries first\n"
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering " -o --output=STRING Change journal output mode (short, short-iso,\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " short-precise, short-monotonic, verbose,\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " export, json, json-pretty, json-sse, cat)\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " -x --catalog Add message explanations where available\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " --no-full Ellipsize fields\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " -a --all Show all fields, including long and unprintable\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " -q --quiet Do not show privilege warning\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " --no-pager Do not pipe output into a pager\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " -m --merge Show entries from all available journals\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " -D --directory=PATH Show journal files from directory\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --file=PATH Show journal file\n"
9c0a72f961e00b0447767973e7117e131bea5b5dTom Gundersen " --root=ROOT Operate on catalog files underneath the root ROOT\n"
9c0a72f961e00b0447767973e7117e131bea5b5dTom Gundersen " --interval=TIME Time interval for changing the FSS sealing key\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --verify-key=KEY Specify FSS verification key\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --force Force overriding of the FSS key pair with --setup-keys\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen "\nCommands:\n"
6a24f1484fcc1f59f89617afbe4282667a358eabTom Gundersen " -h --help Show this help text\n"
6a24f1484fcc1f59f89617afbe4282667a358eabTom Gundersen " --version Show package version\n"
bbf7c04821a71fec67eaf0e7a34d17afc5913c13Tom Gundersen " --new-id128 Generate a new 128-bit ID\n"
bbf7c04821a71fec67eaf0e7a34d17afc5913c13Tom Gundersen " --header Show journal header information\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --disk-usage Show total disk usage of all journal files\n"
52433f6b65eccd1c54606dde999610640f3458acTom Gundersen " -F --field=FIELD List all values that a specified field takes\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --list-catalog Show message IDs of all entries in the message catalog\n"
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering " --dump-catalog Show entries in the message catalog\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --update-catalog Update the message catalog database\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --setup-keys Generate a new FSS key pair\n"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen " --verify Verify journal file consistency\n"
2ad8416dd057e7e3185169609ca3006e7649f576Zbigniew Jędrzejewski-Szmek , program_invocation_short_name);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstatic int parse_argv(int argc, char *argv[]) {
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen { "version" , no_argument, NULL, ARG_VERSION },
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen { "no-pager", no_argument, NULL, ARG_NO_PAGER },
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen { "no-full", no_argument, NULL, ARG_NO_FULL },
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen { "no-tail", no_argument, NULL, ARG_NO_TAIL },
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen { "new-id128", no_argument, NULL, ARG_NEW_ID128 },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "list-boots", no_argument, NULL, ARG_LIST_BOOTS },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "this-boot", optional_argument, NULL, 'b' }, /* deprecated */
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "directory", required_argument, NULL, 'D' },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "file", required_argument, NULL, ARG_FILE },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "root", required_argument, NULL, ARG_ROOT },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "identifier", required_argument, NULL, 't' },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "setup-keys", no_argument, NULL, ARG_SETUP_KEYS },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "interval", required_argument, NULL, ARG_INTERVAL },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "verify-key", required_argument, NULL, ARG_VERIFY_KEY },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "disk-usage", no_argument, NULL, ARG_DISK_USAGE },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "after-cursor", required_argument, NULL, ARG_AFTER_CURSOR },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "show-cursor", no_argument, NULL, ARG_SHOW_CURSOR },
7951dea20911969287878e6897b3eca348721adeSusant Sahani { "since", required_argument, NULL, ARG_SINCE },
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani { "until", required_argument, NULL, ARG_UNTIL },
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani { "user-unit", required_argument, NULL, ARG_USER_UNIT },
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani { "list-catalog", no_argument, NULL, ARG_LIST_CATALOG },
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani { "dump-catalog", no_argument, NULL, ARG_DUMP_CATALOG },
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani { "update-catalog", no_argument, NULL, ARG_UPDATE_CATALOG },
f882c247ad59776c3a7753bb963c1f8e2386cb79Tom Gundersen while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:t:u:F:xrM:", options, NULL)) >= 0)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen log_error("Unknown output format '%s'.", optarg);
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen if (r < 0 || arg_lines < 0) {
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen log_error("Failed to parse lines '%s'", optarg);
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen /* Hmm, no argument? Maybe the next
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen * word on the command line is
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen * supposed to be the argument? Let's
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen * see if there is one, and is
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen * parsable as a positive
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen * integer... */
arg_no_tail = true;
case ARG_NEW_ID128:
arg_quiet = true;
arg_merge = true;
arg_boot = true;
if (optarg) {
return -EINVAL;
optind++;
case ARG_LIST_BOOTS:
case ARG_SYSTEM:
case ARG_USER:
case ARG_FILE:
case ARG_ROOT:
case ARG_AFTER_CURSOR:
case ARG_SHOW_CURSOR:
arg_show_cursor = true;
case ARG_HEADER:
case ARG_VERIFY:
case ARG_DISK_USAGE:
#ifdef HAVE_GCRYPT
case ARG_FORCE:
arg_force = true;
case ARG_SETUP_KEYS:
case ARG_VERIFY_KEY:
arg_merge = false;
case ARG_INTERVAL:
if (r < 0 || arg_interval <= 0) {
return -EINVAL;
case ARG_SETUP_KEYS:
case ARG_VERIFY_KEY:
case ARG_INTERVAL:
case ARG_FORCE:
return -ENOTSUP;
const char *dots;
if (dots) {
return log_oom();
free(a);
return -EINVAL;
arg_priorities = 0;
return -EINVAL;
arg_priorities = 0;
case ARG_SINCE:
return -EINVAL;
arg_since_set = true;
case ARG_UNTIL:
return -EINVAL;
arg_until_set = true;
return log_oom();
return log_oom();
case ARG_USER_UNIT:
return log_oom();
arg_catalog = true;
case ARG_LIST_CATALOG:
case ARG_DUMP_CATALOG:
case ARG_UPDATE_CATALOG:
arg_reverse = true;
return -EINVAL;
return -EINVAL;
return -EINVAL;
return -EINVAL;
return -EINVAL;
return -EINVAL;
static int generate_new_id128(void) {
bool have_term = false;
assert(j);
if (!have_term)
r = sd_journal_add_disjunction(j);
have_term = false;
} else if (path_is_absolute(*i)) {
const char *path;
p = canonicalize_file_name(*i);
path = p ? p : *i;
return -errno;
if (!comm)
return log_oom();
if (!t2)
return log_oom();
return -ENOMEM;
return -ENOMEM;
return -EINVAL;
return log_oom();
r = sd_journal_add_match(j, t, 0);
if (t2)
have_term = true;
r = sd_journal_add_match(j, *i, 0);
have_term = true;
return -EINVAL;
static int boot_id_cmp(const void *a, const void *b) {
const void *data;
unsigned int count = 0;
return log_oom();
r = sd_journal_seek_head(j);
r = sd_journal_next(j);
goto flush;
r = sd_journal_seek_tail(j);
r = sd_journal_previous(j);
goto flush;
count++;
const void *data;
unsigned int count = 0;
assert(j);
return log_oom();
r = sd_journal_seek_head(j);
r = sd_journal_next(j);
goto flush;
count++;
return -EADDRNOTAVAIL;
if (!id ||
return -EADDRNOTAVAIL;
assert(j);
if (!arg_boot)
r = sd_journal_add_conjunction(j);
assert(j);
if (!arg_dmesg)
r = sd_journal_add_conjunction(j);
const char *fields,
char **patterns,
const char *field;
if (!found)
return log_oom();
const void *data;
if (eq)
prefix = 0;
return log_oom();
u = NULL;
if (r < 0 && r != -EEXIST)
#define SYSTEM_UNITS \
#define USER_UNITS \
int r, count = 0;
assert(j);
return log_oom();
if (string_is_glob(u)) {
u = NULL;
r = add_matches_for_unit(j, u);
r = sd_journal_add_disjunction(j);
count ++;
r = add_matches_for_unit(j, u);
r = sd_journal_add_disjunction(j);
count ++;
return log_oom();
if (string_is_glob(u)) {
u = NULL;
r = sd_journal_add_disjunction(j);
count ++;
r = sd_journal_add_disjunction(j);
count ++;
return -ENODATA;
r = sd_journal_add_conjunction(j);
assert(j);
r = sd_journal_add_conjunction(j);
assert(j);
r = sd_journal_add_match(j, u, 0);
r = sd_journal_add_disjunction(j);
r = sd_journal_add_conjunction(j);
static int setup_keys(void) {
#ifdef HAVE_GCRYPT
ssize_t l;
struct FSSHeader h;
uint64_t n;
return -errno;
return log_oom();
if (arg_force) {
r = unlink(p);
r = -errno;
goto finish;
r = -EEXIST;
goto finish;
r = log_oom();
goto finish;
if (fd < 0) {
r = -errno;
goto finish;
r = -EIO;
goto finish;
n /= arg_interval;
if (fd < 0) {
r = -errno;
goto finish;
zero(h);
if (l < 0 || (size_t) l != sizeof(h)) {
r = -EIO;
goto finish;
r = -EIO;
goto finish;
if (link(k, p) < 0) {
r = -errno;
goto finish;
if (on_tty()) {
"The new key pair has been generated. The " ANSI_HIGHLIGHT_ON "secret sealing key" ANSI_HIGHLIGHT_OFF " has been written to\n"
"Please write down the following " ANSI_HIGHLIGHT_ON "secret verification key" ANSI_HIGHLIGHT_OFF ". It should be stored\n"
for (i = 0; i < seed_size; i++) {
if (on_tty()) {
if (hn) {
fprintf(stderr, "\nThe keys have been generated for host %s/" SD_ID128_FORMAT_STR ".\n", hn, SD_ID128_FORMAT_VAL(machine));
fprintf(stderr, "\nThe keys have been generated for host " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(machine));
#ifdef HAVE_QRENCODE
if (is_locale_utf8()) {
fputs("\nTo transfer the verification key to your phone please scan the QR code below:\n\n", stderr);
unlink(k);
free(k);
free(p);
return -ENOTSUP;
Iterator i;
JournalFile *f;
assert(j);
log_show_color(true);
#ifdef HAVE_GCRYPT
log_notice("Journal file %s has sealing enabled but verification key has not been passed using --verify-key=.", f->path);
if (k == -EINVAL) {
if (validated > 0) {
} else if (last > 0)
#ifdef HAVE_ACL
bool have_access;
assert(j);
if (!have_access) {
if (!have_access) {
if (strv_isempty(g))
return log_oom();
strv_sort(g);
strv_uniq(g);
return log_oom();
void *code;
assert(j);
#ifdef HAVE_ACL
geteuid() != 0 &&
return -EACCES;
r = access_check_var_log_journal(j);
return -EACCES;
r = -EACCES;
int err;
bool need_seek = false;
int n_shown = 0;
bool ellipsized = false;
log_open();
goto finish;
r = generate_new_id128();
goto finish;
r = setup_keys();
goto finish;
if (!database) {
r = log_oom();
goto finish;
goto finish;
if (arg_directory)
else if (arg_file)
else if (arg_machine)
strerror(-r));
return EXIT_FAILURE;
r = access_check(j);
return EXIT_FAILURE;
r = verify(j);
goto finish;
return EXIT_SUCCESS;
return EXIT_FAILURE;
return EXIT_SUCCESS;
r = list_boots(j);
goto finish;
r = add_boot(j);
return EXIT_FAILURE;
r = add_dmesg(j);
return EXIT_FAILURE;
r = add_units(j);
return EXIT_FAILURE;
r = add_syslog_identifier(j);
return EXIT_FAILURE;
r = add_priorities(j);
return EXIT_FAILURE;
return EXIT_FAILURE;
if (arg_field) {
const void *data;
r = sd_journal_set_data_threshold(j, 0);
return EXIT_FAILURE;
return EXIT_FAILURE;
const void *eq;
if (eq)
printf("%.*s\n", (int) (size - ((const uint8_t*) eq - (const uint8_t*) data + 1)), (const char*) eq + 1);
n_shown ++;
return EXIT_SUCCESS;
if (arg_follow) {
r = sd_journal_get_fd(j);
return EXIT_FAILURE;
return EXIT_FAILURE;
if (!arg_reverse)
arg_lines = 0;
return EXIT_FAILURE;
r = sd_journal_next(j);
return EXIT_FAILURE;
r = sd_journal_previous(j);
} else if (arg_lines >= 0) {
r = sd_journal_seek_tail(j);
return EXIT_FAILURE;
} else if (arg_reverse) {
r = sd_journal_seek_tail(j);
return EXIT_FAILURE;
r = sd_journal_previous(j);
r = sd_journal_seek_head(j);
return EXIT_FAILURE;
r = sd_journal_next(j);
return EXIT_FAILURE;
if (!arg_follow)
if (!arg_quiet) {
goto finish;
if (arg_follow)
int flags;
if (need_seek) {
if (!arg_reverse)
r = sd_journal_next(j);
r = sd_journal_previous(j);
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
if (!arg_merge) {
if (previous_boot_id_valid &&
previous_boot_id_valid = true;
flags =
need_seek = true;
if (r == -EADDRNOTAVAIL)
goto finish;
n_shown++;
if (!arg_follow) {
if (arg_show_cursor) {
if (r < 0 && r != -EADDRNOTAVAIL)
goto finish;
first_line = false;
pager_close();