1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

man/sd_journal_next: fix argument in example

The example does not compile, it fails with:

error: passing argument 3 of ‘sd_journal_get_data’ from incompatible
pointer type

Cast to (const void **) to avoid this.
This commit is contained in:
Christian Hesse 2014-07-01 10:22:50 +02:00 committed by Lennart Poettering
parent 793c098f0a
commit 8959ae0d4c
Notes: Lennart Poettering 2014-07-03 20:43:12 +02:00
Backport: documentation

View File

@ -183,7 +183,7 @@ int main(int argc, char *argv[]) {
const char *d;
size_t l;
r = sd_journal_get_data(j, "MESSAGE", &d, &l);
r = sd_journal_get_data(j, "MESSAGE", (const void **)&d, &l);
if (r < 0) {
fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
continue;