diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2017-07-03 13:11:38 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2017-07-17 21:00:52 -0400 |
commit | d756b35032cdf7fdaaf0d6611388a54d32d72e92 (patch) | |
tree | 21c9626d87fde1c935755862811b339dc7338ad1 /src/svm/ssvm.c | |
parent | 365a2b851024080c2f8f59bce2b61f243a85c254 (diff) |
Fix unlinking of /dev/shm files.
- api-segment prefix not used when unlinking shm files
- unlink root region on exit if no clients referenced
- stale reference to freed segment name
- don't add fake client to /db unless CLIB_DEBUG > 2
- turn off the gmond plugin
- clean up unused vars in vpp/api
Change-Id: I66451fcfd6ee64a12466c2d6c209050e3cdb74b7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/svm/ssvm.c')
-rw-r--r-- | src/svm/ssvm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c index 6cda1f279e8..23e3cf443c3 100644 --- a/src/svm/ssvm.c +++ b/src/svm/ssvm.c @@ -29,6 +29,9 @@ ssvm_master_init (ssvm_private_t * ssvm, u32 master_index) if (ssvm->ssvm_size == 0) return SSVM_API_ERROR_NO_SIZE; + if (CLIB_DEBUG > 1) + clib_warning ("[%d] creating segment '%s'", getpid (), ssvm->name); + ssvm_filename = format (0, "/dev/shm/%s%c", ssvm->name, 0); unlink ((char *) ssvm_filename); @@ -176,12 +179,18 @@ ssvm_delete (ssvm_private_t * ssvm) fn = format (0, "/dev/shm/%s%c", ssvm->name, 0); + if (CLIB_DEBUG > 1) + clib_warning ("[%d] unlinking ssvm (%s) backing file '%s'", getpid (), + ssvm->name, fn); + /* Throw away the backing file */ if (unlink ((char *) fn) < 0) clib_unix_warning ("unlink segment '%s'", ssvm->name); - munmap ((void *) ssvm->requested_va, ssvm->ssvm_size); vec_free (fn); + vec_free (ssvm->name); + + munmap ((void *) ssvm->requested_va, ssvm->ssvm_size); } |