summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-06 17:13:06 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-06 19:18:00 +0200
commit03256707111ce2409de0857c65482512e42d9238 (patch)
treeeccf66deb8f0a8c1d0b610fbedc69142f5886243 /src/lib/dev.c
parent90c3c96b5c9b1e4db6bb6d1894a21aec54a965b1 (diff)
downloadouroboros-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/dev.c')
-rw-r--r--src/lib/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index d85afc45..f13c8423 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -113,10 +113,10 @@ void ap_fini(void)
if (_ap_instance->fds != NULL)
bmp_destroy(_ap_instance->fds);
- if (_ap_instance->dum != NULL)
- shm_du_map_close(_ap_instance->dum);
if (_ap_instance->rb != NULL)
shm_ap_rbuff_destroy(_ap_instance->rb);
+ if (_ap_instance->dum != NULL)
+ shm_du_map_close_on_exit(_ap_instance->dum);
pthread_rwlock_rdlock(&_ap_instance->flows_lock);