mirror of
https://github.com/systemd/systemd
synced 2024-10-06 16:21:34 +00:00
man: fix compilation of example
This commit is contained in:
parent
11dac832c7
commit
1d98d9a62c
|
@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const char *d;
|
const void *d;
|
||||||
size_t l;
|
size_t l;
|
||||||
r = sd_journal_next(j);
|
r = sd_journal_next(j);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
@ -233,7 +233,7 @@ int main(int argc, char *argv[]) {
|
||||||
fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
|
fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
printf("%.*s\n", (int) l, d);
|
printf("%.*s\n", (int) l, (const char*) d);
|
||||||
}
|
}
|
||||||
sd_journal_close(j);
|
sd_journal_close(j);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -248,9 +248,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
int wait_for_changes(sd_journal *j) {
|
int wait_for_changes(sd_journal *j) {
|
||||||
struct pollfd pollfd;
|
struct pollfd pollfd;
|
||||||
pollfd.fd = sd_journal_get_fd();
|
pollfd.fd = sd_journal_get_fd(j);
|
||||||
pollfd.events = POLLIN;
|
pollfd.events = POLLIN;
|
||||||
poll(&pollfd, 1, sd_journal_reliable_fd() > 0 ? -1 : 2000);
|
poll(&pollfd, 1, sd_journal_reliable_fd(j) > 0 ? -1 : 2000);
|
||||||
return sd_journal_process(j);
|
return sd_journal_process(j);
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
# the Free Software Foundation; either version 2.1 of the License, or
|
# the Free Software Foundation; either version 2.1 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
# See sysctl.d(5) for details
|
# See sysctl.d(5) and core(5) for for details.
|
||||||
|
|
||||||
kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %p %u %g %s %t %e
|
kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %p %u %g %s %t %e
|
||||||
|
|
Loading…
Reference in a new issue