Messages in this thread Patch in this message |  | | | Subject | Re: 2.3.51: shm | | From | Christoph Rohland <> | | Date | 13 Mar 2000 13:44:23 +0100 |
| |
Lawrence Manning <lawrence@aslak.demon.co.uk> writes:
> I had to mount shm in order to do some testing, and now I find the > following in my shm dir: > > [root@aslak /var]# ls shm/ -la > total 4 > drwxrwxrwt 2 root root 0 Mar 12 15:50 / > drwxrwxrwt 2 root root 0 Mar 12 15:50 ./ > drwxr-xr-x 16 root root 4096 Mar 12 15:40 ../ > > What is that / file doing there?
This was an oversight while merging the /dev/zero stuff with shm fs.
Attached patch fixes this.
Greetings Christoph
--- 2.3.51/ipc/shm.c Mon Mar 13 10:51:33 2000 +++ make51/ipc/shm.c Mon Mar 13 11:50:38 2000 @@ -435,6 +435,8 @@ default: down(&shm_ids.sem); for (; nr-2 <= shm_ids.max_id; nr++ ) { + if (nr-2 == zero_id) + continue; if (!(shp = shm_get (nr-2))) continue; if (shp->shm_perm.mode & SHM_DEST) @@ -462,8 +464,10 @@ down(&shm_ids.sem); for(i = 0; i <= shm_ids.max_id; i++) { + if (i == zero_id) + continue; if (!(shp = shm_lock(i))) - continue; + continue; if (!(shp->shm_perm.mode & SHM_DEST) && dent->d_name.len == shp->shm_namelen && strncmp(dent->d_name.name, shp->shm_name, shp->shm_namelen) == 0) |  |