shmget: Make shmobj underwent IPC_RMID invisible to shmget
Refs: #926 Change-Id: I16120623b581da5d5d484fd05d5111788c8ad5e2
This commit is contained in:
committed by
Masamichi Takagi
parent
229b041320
commit
9bb8076dc0
@@ -295,6 +295,7 @@ void shmobj_destroy(struct shmobj *obj)
|
||||
--the_shm_info.used_ids;
|
||||
|
||||
list_add(&obj->chain, &kds_free_list);
|
||||
/* For index reuse, release in descending order of index. */
|
||||
for (;;) {
|
||||
struct shmobj *p;
|
||||
|
||||
|
||||
@@ -4758,7 +4758,8 @@ int shmobj_list_lookup_by_key(key_t key, struct shmobj **objp)
|
||||
struct shmobj *obj;
|
||||
|
||||
list_for_each_entry(obj, &kds_list, chain) {
|
||||
if (obj->ds.shm_perm.key == key) {
|
||||
if (obj->ds.shm_perm.key == key &&
|
||||
!(obj->ds.shm_perm.mode & SHM_DEST)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user