[systemd-devel] [PATCH 1/2] man/sd_journal_next: fix argument in example

Christian Hesse list at eworm.de
Tue Jul 1 01:22:50 PDT 2014


From: Christian Hesse <mail at eworm.de>

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/sd_journal_next.xml b/man/sd_journal_next.xml
index 0216d6e..5e691a1 100644
--- a/man/sd_journal_next.xml
+++ b/man/sd_journal_next.xml
@@ -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;
-- 
2.0.1



More information about the systemd-devel mailing list