diff options
author | dimitri staessens <[email protected]> | 2016-07-06 17:13:06 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-07-06 19:18:00 +0200 |
commit | 03256707111ce2409de0857c65482512e42d9238 (patch) | |
tree | eccf66deb8f0a8c1d0b610fbedc69142f5886243 /src/lib/shm_ap_rbuff.c | |
parent | 90c3c96b5c9b1e4db6bb6d1894a21aec54a965b1 (diff) | |
download | ouroboros-03256707111ce2409de0857c65482512e42d9238.tar.gz ouroboros-03256707111ce2409de0857c65482512e42d9238.zip |
lib: shm_du_map: Clean sdus upon exit
When an application closes the shm_du_map, it will clean all remaining
sdu's for that application. Adds a function to clean the shm_du_map on
close.
Fixes #20.
Diffstat (limited to 'src/lib/shm_ap_rbuff.c')
-rw-r--r-- | src/lib/shm_ap_rbuff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c index e90afe19..4eb91136 100644 --- a/src/lib/shm_ap_rbuff.c +++ b/src/lib/shm_ap_rbuff.c @@ -36,6 +36,7 @@ #include <stdint.h> #include <unistd.h> #include <errno.h> +#include <signal.h> #include <sys/stat.h> #define SHM_RBUFF_FILE_SIZE (SHM_RBUFF_SIZE * sizeof(struct rb_entry) \ @@ -161,7 +162,7 @@ struct shm_ap_rbuff * shm_ap_rbuff_open(pid_t api) shm_fd = shm_open(fn, O_RDWR, 0666); if (shm_fd == -1) { - LOG_DBGF("Failed opening shared memory %s.", fn); + LOG_DBGF("%d failed opening shared memory %s.", getpid(), fn); return NULL; } |