diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-11-05 13:15:31 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-11-05 13:15:31 +0300 |
commit | 92beb4638f08452261beab4629d74aee759b1732 (patch) | |
tree | 6c38a782a41ecd3bdf97b5056d3bad4a8748956c /winsup | |
parent | 026d54aa230bfed6301995374fb163ef3b5b4c25 (diff) |
* shm.cc (shmctl): On IPC_RMID also unmap all views on shared mem
as well as connected shm_attached_list entry.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/shm.cc | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9044a0ee6..a4905aa2a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2007-11-05 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmctl): On IPC_RMID also unmap all views on shared mem + as well as connected shm_attached_list entry. + 2007-10-31 Corinna Vinschen <corinna@vinschen.de> * net.cc (load_ipv6_funcs): Use MAX_PATH instead of CYG_MAX_PATH. diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index f6cc30baf..27cc9843c 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -265,6 +265,19 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf) { if (ssh_entry->shmid == shmid) { + shm_attached_list *sph_entry, *sph_next_entry; + SLIST_FOREACH_SAFE (sph_entry, &sph_list, sph_next, + sph_next_entry) + { + if (sph_entry->hdl == ssh_entry->hdl) + { + SLIST_REMOVE (&sph_list, sph_entry, shm_attached_list, + sph_next); + /* ...unmap all views for this handle... */ + UnmapViewOfFile (sph_entry->ptr); + delete sph_entry; + } + } SLIST_REMOVE (&ssh_list, ssh_entry, shm_shmid_list, ssh_next); /* ...and close the handle. */ CloseHandle (ssh_entry->hdl); |