summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-12 02:19:26 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-12 02:19:26 +0200
commit7211f918ba2b86e0041413b47d51d7593e73cf5d (patch)
tree7939fe6f96e16b6e148d1f8a2e0ec35b130df574 /src/libsystemd-bus/bus-kernel.c
parentacb5a3cb20d075782e088362d4ec9aa9f3996d90 (diff)
bus: make the kdbus code valgrind clean
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 1b2297fbb4..ed4e189c3e 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -19,6 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
#include <fcntl.h>
#include "util.h"
@@ -32,8 +36,6 @@
(uint8_t*) (d) < (uint8_t*) (k) + (k)->size; \
(d) = (struct kdbus_msg_data*) ((uint8_t*) (d) + ALIGN8((d)->size)))
-
-
static int parse_unique_name(const char *s, uint64_t *id) {
int r;
@@ -353,6 +355,11 @@ int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m) {
k = bus->rbuffer = q;
k->size = sz;
+ /* Let's tell valgrind that there's really no need to
+ * initialize this fully. This should be removed again
+ * when valgrind learned the kdbus ioctls natively. */
+ VALGRIND_MAKE_MEM_DEFINED(k, sz);
+
r = ioctl(bus->input_fd, KDBUS_CMD_MSG_RECV, bus->rbuffer);
if (r >= 0)
break;