chiark / gitweb /
man/sd_journal_next: fix argument in example
authorChristian Hesse <mail@eworm.de>
Tue, 1 Jul 2014 08:22:50 +0000 (10:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Jul 2014 14:38:37 +0000 (16:38 +0200)
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.

man/sd_journal_next.xml

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