summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index fd19ff32b0..5e66a31162 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -27,6 +27,7 @@
#include <sys/poll.h>
#include <byteswap.h>
#include <sys/mman.h>
+#include <pthread.h>
#include "util.h"
#include "macro.h"
@@ -106,6 +107,8 @@ static void bus_free(sd_bus *b) {
bus_kernel_flush_memfd(b);
+ assert_se(pthread_mutex_destroy(&b->memfd_cache_mutex) == 0);
+
free(b);
}
@@ -125,6 +128,8 @@ int sd_bus_new(sd_bus **ret) {
r->negotiate_fds = true;
r->original_pid = getpid();
+ assert_se(pthread_mutex_init(&r->memfd_cache_mutex, NULL) == 0);
+
/* We guarantee that wqueue always has space for at least one
* entry */
r->wqueue = new(sd_bus_message*, 1);