diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 10:52:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 10:52:33 +0000 |
commit | 2c3307fb903f427be3d021c5780b75cac9af2ce8 (patch) | |
tree | 65cf431f40b7481d81ae2dfce9576342686448f7 /upstream/debian-unstable/man3/sd_journal_get_fd.3 | |
parent | Releasing progress-linux version 4.22.0-1~progress7.99u1. (diff) | |
download | manpages-l10n-2c3307fb903f427be3d021c5780b75cac9af2ce8.tar.xz manpages-l10n-2c3307fb903f427be3d021c5780b75cac9af2ce8.zip |
Merging upstream version 4.23.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-unstable/man3/sd_journal_get_fd.3')
-rw-r--r-- | upstream/debian-unstable/man3/sd_journal_get_fd.3 | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/upstream/debian-unstable/man3/sd_journal_get_fd.3 b/upstream/debian-unstable/man3/sd_journal_get_fd.3 index 1a48a211..9b6208e3 100644 --- a/upstream/debian-unstable/man3/sd_journal_get_fd.3 +++ b/upstream/debian-unstable/man3/sd_journal_get_fd.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_JOURNAL_GET_FD" "3" "" "systemd 255" "sd_journal_get_fd" +.TH "SD_JOURNAL_GET_FD" "3" "" "systemd 256~rc3" "sd_journal_get_fd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -250,39 +250,38 @@ Iterating through the journal, in a live view tracking all changes: int main(int argc, char *argv[]) { int r; sd_journal *j; + r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); if (r < 0) { - errno = \-r; - fprintf(stderr, "Failed to open journal: %m\en"); + fprintf(stderr, "Failed to open journal: %s\en", strerror(\-r)); return 1; } + for (;;) { const void *d; size_t l; r = sd_journal_next(j); if (r < 0) { - errno = \-r; - fprintf(stderr, "Failed to iterate to next entry: %m\en"); + fprintf(stderr, "Failed to iterate to next entry: %s\en", strerror(\-r)); break; } if (r == 0) { /* Reached the end, let\*(Aqs wait for changes, and try again */ r = sd_journal_wait(j, (uint64_t) \-1); if (r < 0) { - errno = \-r; - fprintf(stderr, "Failed to wait for changes: %m\en"); + fprintf(stderr, "Failed to wait for changes: %s\en", strerror(\-r)); break; } continue; } r = sd_journal_get_data(j, "MESSAGE", &d, &l); if (r < 0) { - errno = \-r; - fprintf(stderr, "Failed to read message field: %m\en"); + fprintf(stderr, "Failed to read message field: %s\en", strerror(\-r)); continue; } printf("%\&.*s\en", (int) l, (const char*) d); } + sd_journal_close(j); return 0; } @@ -301,6 +300,7 @@ Waiting with .nf /* SPDX\-License\-Identifier: MIT\-0 */ +#define _GNU_SOURCE 1 #include <poll\&.h> #include <time\&.h> #include <systemd/sd\-journal\&.h> @@ -346,9 +346,4 @@ and were added in version 201\&. .SH "SEE ALSO" .PP -\fBsystemd\fR(1), -\fBsd-journal\fR(3), -\fBsd_journal_open\fR(3), -\fBsd_journal_next\fR(3), -\fBpoll\fR(2), -\fBclock_gettime\fR(2) +\fBsystemd\fR(1), \fBsd-journal\fR(3), \fBsd_journal_open\fR(3), \fBsd_journal_next\fR(3), \fBpoll\fR(2), \fBclock_gettime\fR(2) |