diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2003-08-30 21:32:59 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-08-30 21:32:59 -0700 |
| commit | 969d2acab75fbb314baa195a6256cb6df1564655 (patch) | |
| tree | ebbe9dc3e60d41d83c521f6fe40c146a13d571eb /ipc | |
| parent | 6cf7367489c7b055b6e02519de29d48c9ef238bb (diff) | |
[PATCH] More ->pid to ->tgid changes
One more overlooked area where the proper process ID has to be used:
SysV IPC "pid" values should use the thread group ID, not the per-thread
one.
Diffstat (limited to 'ipc')
| -rw-r--r-- | ipc/msg.c | 4 | ||||
| -rw-r--r-- | ipc/sem.c | 8 | ||||
| -rw-r--r-- | ipc/shm.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index c1e6bb646990..e9f5cecfdd4c 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -707,7 +707,7 @@ retry: goto retry; } - msq->q_lspid = current->pid; + msq->q_lspid = current->tgid; msq->q_stime = get_seconds(); if(!pipelined_send(msq,msg)) { @@ -801,7 +801,7 @@ retry: list_del(&msg->m_list); msq->q_qnum--; msq->q_rtime = get_seconds(); - msq->q_lrpid = current->pid; + msq->q_lrpid = current->tgid; msq->q_cbytes -= msg->m_ts; atomic_sub(msg->m_ts,&msg_bytes); atomic_dec(&msg_hdrs); diff --git a/ipc/sem.c b/ipc/sem.c index b0d886377bb7..81aa6977c993 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -664,7 +664,7 @@ static int semctl_main(int semid, int semnum, int cmd, int version, union semun for (un = sma->undo; un; un = un->id_next) un->semadj[semnum] = 0; curr->semval = val; - curr->sempid = current->pid; + curr->sempid = current->tgid; sma->sem_ctime = get_seconds(); /* maybe some queued-up processes were waiting for this */ update_queue(sma); @@ -1052,7 +1052,7 @@ retry_undos: if (error) goto out_unlock_free; - error = try_atomic_semop (sma, sops, nsops, un, current->pid); + error = try_atomic_semop (sma, sops, nsops, un, current->tgid); if (error <= 0) goto update; @@ -1064,7 +1064,7 @@ retry_undos: queue.sops = sops; queue.nsops = nsops; queue.undo = un; - queue.pid = current->pid; + queue.pid = current->tgid; queue.id = semid; if (alter) append_to_queue(sma ,&queue); @@ -1206,7 +1206,7 @@ found: sem->semval += u->semadj[i]; if (sem->semval < 0) sem->semval = 0; /* shouldn't happen */ - sem->sempid = current->pid; + sem->sempid = current->tgid; } } sma->sem_otime = get_seconds(); diff --git a/ipc/shm.c b/ipc/shm.c index ff26adee978e..516a17e10338 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -89,7 +89,7 @@ static inline void shm_inc (int id) { if(!(shp = shm_lock(id))) BUG(); shp->shm_atim = get_seconds(); - shp->shm_lprid = current->pid; + shp->shm_lprid = current->tgid; shp->shm_nattch++; shm_unlock(shp); } @@ -136,7 +136,7 @@ static void shm_close (struct vm_area_struct *shmd) /* remove from the list of attaches of the shm segment */ if(!(shp = shm_lock(id))) BUG(); - shp->shm_lprid = current->pid; + shp->shm_lprid = current->tgid; shp->shm_dtim = get_seconds(); shp->shm_nattch--; if(shp->shm_nattch == 0 && @@ -209,7 +209,7 @@ static int newseg (key_t key, int shmflg, size_t size) if(id == -1) goto no_id; - shp->shm_cprid = current->pid; + shp->shm_cprid = current->tgid; shp->shm_lprid = 0; shp->shm_atim = shp->shm_dtim = 0; shp->shm_ctim = get_seconds(); |
