chiark / gitweb /
sd-bus: explicitly cast asprintf() return value away we are not interested in
authorLennart Poettering <lennart@poettering.net>
Mon, 27 Oct 2014 12:06:11 +0000 (13:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 27 Oct 2014 12:06:20 +0000 (13:06 +0100)
Let's give coverity a hint what's going on here.

src/libsystemd/sd-bus/sd-bus.c

index c2931a7..03ec603 100644 (file)
@@ -1157,13 +1157,13 @@ int bus_set_address_user(sd_bus *b) {
                         return -ENOMEM;
 
 #ifdef ENABLE_KDBUS
                         return -ENOMEM;
 
 #ifdef ENABLE_KDBUS
-                asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, getuid(), ee);
+                (void) asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, getuid(), ee);
 #else
 #else
-                asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
+                (void) asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
 #endif
         } else {
 #ifdef ENABLE_KDBUS
 #endif
         } else {
 #ifdef ENABLE_KDBUS
-                asprintf(&b->address, KERNEL_USER_BUS_FMT, getuid());
+                (void) asprintf(&b->address, KERNEL_USER_BUS_FMT, getuid());
 #else
                 return -ECONNREFUSED;
 #endif
 #else
                 return -ECONNREFUSED;
 #endif