unlink the mmap file when the monitor object is destroyed
This commit is contained in:
parent
49d8e35e56
commit
6c7d71361a
|
@ -674,6 +674,13 @@ Monitor::~Monitor()
|
||||||
if ( munmap( mem_ptr, mem_size ) < 0 )
|
if ( munmap( mem_ptr, mem_size ) < 0 )
|
||||||
Fatal( "Can't munmap: %s", strerror(errno) );
|
Fatal( "Can't munmap: %s", strerror(errno) );
|
||||||
close( map_fd );
|
close( map_fd );
|
||||||
|
|
||||||
|
char mmap_path[PATH_MAX] = "";
|
||||||
|
snprintf( mmap_path, sizeof(mmap_path), "%s/zm.mmap.%d", config.path_map, id );
|
||||||
|
|
||||||
|
if ( unlink( mmap_path ) < 0 ) {
|
||||||
|
Warning( "Can't unlink '%s': %s", mmap_path, strerror(errno) );
|
||||||
|
}
|
||||||
#else // ZM_MEM_MAPPED
|
#else // ZM_MEM_MAPPED
|
||||||
struct shmid_ds shm_data;
|
struct shmid_ds shm_data;
|
||||||
if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) {
|
if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue