diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-08-30 21:25:23 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-08-30 21:25:23 +0200 |
commit | 1071824054828b9be36f50416f858c49c9acd701 (patch) | |
tree | 303d3d61717d4d3018b8025a9825ff799da01c08 /src/ipcpd/local | |
parent | 11ae1b5669356fbaf3405e77d36f517f8c1894cc (diff) | |
parent | 52db4952d80a10aae464274acdd7401267818b28 (diff) | |
download | ouroboros-1071824054828b9be36f50416f858c49c9acd701.tar.gz ouroboros-1071824054828b9be36f50416f858c49c9acd701.zip |
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be
Diffstat (limited to 'src/ipcpd/local')
-rw-r--r-- | src/ipcpd/local/main.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index 547e7e28..4fa7e33f 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -24,7 +24,7 @@ #include "ipcp.h" #include "flow.h" #include <ouroboros/errno.h> -#include <ouroboros/shm_du_map.h> +#include <ouroboros/shm_rdrbuff.h> #include <ouroboros/shm_ap_rbuff.h> #include <ouroboros/list.h> #include <ouroboros/utils.h> @@ -67,7 +67,7 @@ struct ipcp * _ipcp; /* the shim needs access to these internals */ struct shim_ap_data { pid_t api; - struct shm_du_map * dum; + struct shm_rdrbuff * rdrb; struct bmp * fds; struct shm_ap_rbuff * rb; @@ -98,8 +98,8 @@ static int shim_ap_init() return -1; } - _ap_instance->dum = shm_du_map_open(); - if (_ap_instance->dum == NULL) { + _ap_instance->rdrb = shm_rdrbuff_open(); + if (_ap_instance->rdrb == NULL) { bmp_destroy(_ap_instance->fds); free(_ap_instance); return -1; @@ -107,7 +107,7 @@ static int shim_ap_init() _ap_instance->rb = shm_ap_rbuff_create(); if (_ap_instance->rb == NULL) { - shm_du_map_close(_ap_instance->dum); + shm_rdrbuff_close(_ap_instance->rdrb); bmp_destroy(_ap_instance->fds); free(_ap_instance); return -1; @@ -139,8 +139,13 @@ void shim_ap_fini() if (_ap_instance->fds != NULL) bmp_destroy(_ap_instance->fds); - if (_ap_instance->dum != NULL) - shm_du_map_close_on_exit(_ap_instance->dum); + + /* remove all remaining sdus */ + while ((i = shm_ap_rbuff_peek_idx(_ap_instance->rb)) >= 0) + shm_rdrbuff_remove(_ap_instance->rdrb, i); + + if (_ap_instance->rdrb != NULL) + shm_rdrbuff_close(_ap_instance->rdrb); if (_ap_instance->rb != NULL) shm_ap_rbuff_destroy(_ap_instance->rb); |