summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-10 21:46:11 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-10 21:46:11 +0200
commite02d1cf72d115d1d61defdca5b551672d876c6bd (patch)
treec4a5a396b17c67b74eba1d7ca7f9d62eb4928b49 /src/shared
parent166503dada92d7ca3570a653e07a51ed826b7c8a (diff)
journal: introduce sd_journal_wait() to simplify writing synchronous clients
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/logs-show.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 697b5cf4b7..540b5a2a2c 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -557,7 +557,6 @@ int show_journal_by_unit(
char *m = NULL;
sd_journal *j = NULL;
int r;
- int fd;
unsigned line = 0;
bool need_seek = false;
@@ -583,10 +582,6 @@ int show_journal_by_unit(
if (r < 0)
goto finish;
- fd = sd_journal_get_fd(j);
- if (fd < 0)
- goto finish;
-
r = sd_journal_add_match(j, m, strlen(m));
if (r < 0)
goto finish;
@@ -663,11 +658,7 @@ int show_journal_by_unit(
if (!follow)
break;
- r = fd_wait_for_event(fd, POLLIN, (usec_t) -1);
- if (r < 0)
- goto finish;
-
- r = sd_journal_process(j);
+ r = sd_journal_wait(j, (usec_t) -1);
if (r < 0)
goto finish;