summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-14 03:19:51 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-14 03:20:23 +0200
commit75722f1d48cf1a93cc4a24e332c9871808c0e641 (patch)
tree6eecbb208a2648c377e83e1a9e2be6205a72d536 /src
parentabad76cc4c8586bc088fec65560cf4db2e0903c2 (diff)
kdbus: make name acquirement ioctls valgrind clean
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-bus/bus-control.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index 185f77c968..5296029fd6 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.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 <stddef.h>
#include <errno.h>
@@ -68,6 +72,10 @@ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
n->id = 0;
memcpy(n->name, name, l+1);
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ VALGRIND_MAKE_MEM_DEFINED(n, n->size);
+#endif
+
r = ioctl(bus->input_fd, KDBUS_CMD_NAME_ACQUIRE, n);
if (r < 0)
return -errno;
@@ -119,6 +127,9 @@ int sd_bus_release_name(sd_bus *bus, const char *name) {
n->id = 0;
memcpy(n->name, name, l+1);
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ VALGRIND_MAKE_MEM_DEFINED(n, n->size);
+#endif
r = ioctl(bus->input_fd, KDBUS_CMD_NAME_RELEASE, n);
if (r < 0)
return -errno;