Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25221
b: refs/heads/master
c: 9ba025f
h: refs/heads/master
i:
  25219: 7bcc90a
v: v3
  • Loading branch information
Eric Sesterhenn authored and Adrian Bunk committed Apr 2, 2006
1 parent 2c8324c commit 734af48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ec70738097af9dfd25d5f83e9b27a532f462912
refs/heads/master: 9ba025f10885758975fbbc2292a5b9e7cb8026a8
15 changes: 7 additions & 8 deletions trunk/ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ static inline int shm_addid(struct shmid_kernel *shp)
static inline void shm_inc (int id) {
struct shmid_kernel *shp;

if(!(shp = shm_lock(id)))
BUG();
shp = shm_lock(id);
BUG_ON(!shp);
shp->shm_atim = get_seconds();
shp->shm_lprid = current->tgid;
shp->shm_nattch++;
Expand Down Expand Up @@ -142,8 +142,8 @@ static void shm_close (struct vm_area_struct *shmd)

mutex_lock(&shm_ids.mutex);
/* remove from the list of attaches of the shm segment */
if(!(shp = shm_lock(id)))
BUG();
shp = shm_lock(id);
BUG_ON(!shp);
shp->shm_lprid = current->tgid;
shp->shm_dtim = get_seconds();
shp->shm_nattch--;
Expand Down Expand Up @@ -283,8 +283,7 @@ asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
err = -EEXIST;
} else {
shp = shm_lock(id);
if(shp==NULL)
BUG();
BUG_ON(shp==NULL);
if (shp->shm_segsz < size)
err = -EINVAL;
else if (ipcperms(&shp->shm_perm, shmflg))
Expand Down Expand Up @@ -774,8 +773,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
up_write(&current->mm->mmap_sem);

mutex_lock(&shm_ids.mutex);
if(!(shp = shm_lock(shmid)))
BUG();
shp = shm_lock(shmid);
BUG_ON(!shp);
shp->shm_nattch--;
if(shp->shm_nattch == 0 &&
shp->shm_perm.mode & SHM_DEST)
Expand Down

0 comments on commit 734af48

Please sign in to comment.