X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd-keepalive%2Fshm.c;h=fbf5bd795583bc47ceb20db6a1f9b2fc97f29e34;hb=fc2ffae923d2b2a6b9b657f195256d30d11bea61;hp=177aa5b8e6156b1cbaf6bed9ee29430c022a80bb;hpb=9f2bb5ce8a275d84146a42d13c981b2ea5e39222;p=dpdk.git diff --git a/examples/l2fwd-keepalive/shm.c b/examples/l2fwd-keepalive/shm.c index 177aa5b8e6..fbf5bd7955 100644 --- a/examples/l2fwd-keepalive/shm.c +++ b/examples/l2fwd-keepalive/shm.c @@ -129,3 +129,13 @@ void rte_keepalive_relayed_state(struct rte_keepalive_shm *shm, strerror(errno)); } } + +void rte_keepalive_shm_cleanup(struct rte_keepalive_shm *ka_shm) +{ + if (shm_unlink(RTE_KEEPALIVE_SHM_NAME) == -1 && errno != ENOENT) + printf("Warning: Error unlinking %s (%s)\n", + RTE_KEEPALIVE_SHM_NAME, strerror(errno)); + + if (ka_shm && munmap(ka_shm, sizeof(struct rte_keepalive_shm)) != 0) + printf("Warning: munmap() failed\n"); +}