summaryrefslogtreecommitdiff
path: root/src/lib/shm_du_map.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-05-15 16:14:13 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-05-15 16:14:13 +0200
commit061758159ebfd38fe03682bd3aa44cf9f8ac915f (patch)
tree0a26ce8198ab305846da06570d336355791e2c30 /src/lib/shm_du_map.c
parent37a0ce98538c69b264898b7994fbac1d6e465a2f (diff)
parent5fe9706b823cd441703239ece020e517d722d88c (diff)
downloadouroboros-061758159ebfd38fe03682bd3aa44cf9f8ac915f.tar.gz
ouroboros-061758159ebfd38fe03682bd3aa44cf9f8ac915f.zip
Merged in dstaesse/ouroboros/release-fd (pull request #89)
lib: cleanup file descriptors for shared memory
Diffstat (limited to 'src/lib/shm_du_map.c')
-rw-r--r--src/lib/shm_du_map.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/shm_du_map.c b/src/lib/shm_du_map.c
index 71c15731..7099b265 100644
--- a/src/lib/shm_du_map.c
+++ b/src/lib/shm_du_map.c
@@ -199,6 +199,9 @@ void shm_du_map_close(struct shm_du_map * dum)
return;
}
+ if (close(dum->fd) < 0)
+ LOG_DBGF("Couldn't close shared memory.");
+
if (munmap(dum->shm_base, SHM_FILE_SIZE) == -1)
LOG_DBGF("Couldn't unmap shared memory.");
@@ -212,6 +215,9 @@ void shm_du_map_destroy(struct shm_du_map * dum)
return;
}
+ if (close(dum->fd) < 0)
+ LOG_DBGF("Couldn't close shared memory.");
+
if (munmap(dum->shm_base, SHM_FILE_SIZE) == -1)
LOG_DBGF("Couldn't unmap shared memory.");