Commit 75722f1d authored by Lennart Poettering's avatar Lennart Poettering

kdbus: make name acquirement ioctls valgrind clean

parent abad76cc
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment