summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-10-05 02:31:54 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-10-05 02:31:54 +0000
commit702ddebbd33b5281de8940a1259bfee02643eafa (patch)
treea123b555cb59cf8441aab8f35b83a0a60f1215a3
parent88b7e4487700d519d4248ae13f22375f02759e2e (diff)
Display/test/use the process PID, not the thread's TID, in a few places.
ok mpi@ mikeb@
-rw-r--r--sys/kern/exec_elf.c4
-rw-r--r--sys/kern/kern_sig.c16
-rw-r--r--sys/kern/kern_xxx.c6
-rw-r--r--sys/uvm/uvm_mmap.c12
4 files changed, 19 insertions, 19 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index dfb45f6a01f..87c850ffeef 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.127 2016/09/12 00:35:54 schwarze Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.128 2016/10/05 02:31:52 guenther Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -899,7 +899,7 @@ ELFNAME(os_pt_note)(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh,
sizeof(pathbuf), NULL);
log(LOG_NOTICE,
"%s(%d): W^X binary outside wxallowed mountpoint\n",
- error ? "" : pathbuf, p->p_pid);
+ error ? "" : pathbuf, p->p_p->ps_pid);
error = EACCES;
goto out1;
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 74ded876432..95e75385e5f 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.205 2016/09/15 02:00:16 dlg Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.206 2016/10/05 02:31:52 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -749,7 +749,7 @@ pgsignal(struct pgrp *pgrp, int signum, int checkctty)
}
/*
- * Send a signal caused by a trap to the current process.
+ * Send a signal caused by a trap to the current thread
* If it will be caught immediately, deliver it with correct code.
* Otherwise, post it normally.
*/
@@ -1203,14 +1203,14 @@ issignal(struct proc *p)
/*
* Don't take default actions on system processes.
*/
- if (p->p_pid <= 1) {
+ if (pr->ps_pid <= 1) {
#ifdef DIAGNOSTIC
/*
* Are you sure you want to ignore SIGSEGV
* in init? XXX
*/
- printf("Process (pid %d) got signal %d\n",
- p->p_pid, signum);
+ printf("Process (pid %d) got signal"
+ " %d\n", pr->ps_pid, signum);
#endif
break; /* == ignore */
}
@@ -1511,7 +1511,7 @@ coredump(struct proc *p)
* that core will silently fail.
*/
len = snprintf(name, sizeof(name), "%s/%s/%u.core",
- dir, p->p_comm, p->p_pid);
+ dir, p->p_comm, pr->ps_pid);
} else if (incrash && nosuidcoredump == 2)
len = snprintf(name, sizeof(name), "%s/%s.core",
dir, p->p_comm);
@@ -1613,10 +1613,10 @@ coredump_write(void *cookie, enum uio_seg segflg, const void *data, size_t len)
if (error) {
if (error == ENOSPC)
log(LOG_ERR, "coredump of %s(%d) failed, filesystem full\n",
- io->io_proc->p_comm, io->io_proc->p_pid);
+ io->io_proc->p_comm, io->io_proc->p_p->ps_pid);
else
log(LOG_ERR, "coredump of %s(%d), write failed: errno %d\n",
- io->io_proc->p_comm, io->io_proc->p_pid, error);
+ io->io_proc->p_comm, io->io_proc->p_p->ps_pid, error);
return (error);
}
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c
index 9d7d9945e8b..83c495b6ed0 100644
--- a/sys/kern/kern_xxx.c
+++ b/sys/kern/kern_xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_xxx.c,v 1.30 2016/09/03 14:46:56 naddy Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.31 2016/10/05 02:31:52 guenther Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
@@ -105,7 +105,7 @@ scdebug_call(struct proc *p, register_t code, const register_t args[])
sy->sy_call == sys_nosys))
return;
- printf("proc %d (%s): %s num ", p->p_pid, p->p_comm, em->e_name);
+ printf("proc %d (%s): %s num ", p->p_p->ps_pid, p->p_comm, em->e_name);
if (code < 0 || code >= em->e_nsysent)
printf("OUT OF RANGE (%d)", code);
else {
@@ -138,7 +138,7 @@ scdebug_ret(struct proc *p, register_t code, int error,
sy->sy_call == sys_nosys))
return;
- printf("proc %d (%s): %s num ", p->p_pid, p->p_comm, em->e_name);
+ printf("proc %d (%s): %s num ", p->p_p->ps_pid, p->p_comm, em->e_name);
if (code < 0 || code >= em->e_nsysent)
printf("OUT OF RANGE (%d)", code);
else
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 04e5d1768fd..5eee33b976b 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.140 2016/09/16 01:09:53 dlg Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.141 2016/10/05 02:31:53 guenther Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -324,7 +324,7 @@ uvm_wxcheck(struct proc *p, char *call)
/* Report W^X failures, and potentially SIGABRT */
if (pr->ps_wxcounter++ == 0)
log(LOG_NOTICE, "%s(%d): %s W^X violation\n",
- p->p_comm, p->p_pid, call);
+ p->p_comm, p->p_p->ps_pid, call);
if (uvm_wxabort) {
struct sigaction sa;
@@ -464,10 +464,10 @@ sys_mmap(struct proc *p, void *v, register_t *retval)
*/
if ((flags & (MAP_SHARED|MAP_PRIVATE)) == 0) {
#if defined(DEBUG)
- printf("WARNING: defaulted mmap() share type to "
- "%s (pid %d comm %s)\n", vp->v_type == VCHR ?
- "MAP_SHARED" : "MAP_PRIVATE", p->p_pid,
- p->p_comm);
+ printf("WARNING: defaulted mmap() share type to"
+ " %s (pid %d comm %s)\n",
+ vp->v_type == VCHR ? "MAP_SHARED" : "MAP_PRIVATE",
+ p->p_p->ps_pid, p->p_comm);
#endif
if (vp->v_type == VCHR)
flags |= MAP_SHARED; /* for a device */