bus: actually unmap kdbus pool after use

This commit is contained in:
Lennart Poettering
2013-05-17 04:26:27 +02:00
parent f54514f354
commit 63edf05ed9
3 changed files with 8 additions and 2 deletions
-2
View File
@@ -45,8 +45,6 @@
#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data)
#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE)
#define KDBUS_POOL_SIZE (4*1024*1024)
static int parse_unique_name(const char *s, uint64_t *id) {
int r;
+4
View File
@@ -33,6 +33,10 @@
* sending vectors */
#define MEMFD_MIN_SIZE (32*1024)
/* The size of the per-connection memory pool that we set up and where
* the kernel places our incoming messages */
#define KDBUS_POOL_SIZE (16*1024*1024)
struct memfd_cache {
int fd;
void *address;
+4
View File
@@ -26,6 +26,7 @@
#include <netdb.h>
#include <sys/poll.h>
#include <byteswap.h>
#include <sys/mman.h>
#include "util.h"
#include "macro.h"
@@ -64,6 +65,9 @@ static void bus_free(sd_bus *b) {
bus_close_fds(b);
if (b->kdbus_buffer)
munmap(b->kdbus_buffer, KDBUS_POOL_SIZE);
free(b->rbuffer);
free(b->unique_name);
free(b->auth_buffer);