From d03b3d84475948695456c89e937ec6174b2da46b Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 13 Mar 1985 02:13:13 -0800 Subject: [PATCH] make swkill messages more informative SCCS-vsn: sys/kern/kern_exec.c 6.10 SCCS-vsn: sys/kern/kern_physio.c 6.5 --- usr/src/sys/kern/kern_exec.c | 6 +++--- usr/src/sys/kern/kern_physio.c | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/usr/src/sys/kern/kern_exec.c b/usr/src/sys/kern/kern_exec.c index 9b03ea80b1..14d36e5845 100644 --- a/usr/src/sys/kern/kern_exec.c +++ b/usr/src/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* kern_exec.c 6.9 85/03/12 */ +/* kern_exec.c 6.10 85/03/12 */ #include "../machine/reg.h" #include "../machine/pte.h" @@ -190,7 +190,7 @@ execve() uap = (struct execa *)u.u_ap; bno = rmalloc(argmap, (long)ctod(clrnd((int)btoc(NCARGS)))); if (bno == 0) { - swkill(u.u_procp, "exece"); + swkill(u.u_procp, "exec: no swap space"); goto bad; } if (bno % CLSIZE) @@ -423,7 +423,7 @@ getxfile(ip, ep, nargc, uid, gid) #endif if (u.u_error) - swkill(u.u_procp, "i/o error mapping pages"); + swkill(u.u_procp, "exec: I/O error mapping pages"); /* * set SUID/SGID protections, if no tracing */ diff --git a/usr/src/sys/kern/kern_physio.c b/usr/src/sys/kern/kern_physio.c index 4d187525d3..fba6adf832 100644 --- a/usr/src/sys/kern/kern_physio.c +++ b/usr/src/sys/kern/kern_physio.c @@ -1,4 +1,4 @@ -/* kern_physio.c 6.4 84/10/31 */ +/* kern_physio.c 6.5 85/03/12 */ #include "../machine/pte.h" @@ -105,7 +105,7 @@ swap(p, dblkno, addr, nbytes, rdflg, flag, dev, pfcent) if (bp->b_flags & B_ERROR) { if ((flag & (B_UAREA|B_PAGET)) || rdflg == B_WRITE) panic("hard IO err in swap"); - swkill(p, (char *)0); + swkill(p, "swap: read error from swap device"); } nbytes -= c; dblkno += btodb(c); @@ -152,14 +152,9 @@ swkill(p, rout) struct proc *p; char *rout; { - char *mesg; - printf("pid %d: ", p->p_pid); - if (rout) - printf(mesg = "killed due to no swap space\n"); - else - printf(mesg = "killed on swap error\n"); - uprintf("sorry, pid %d was %s", p->p_pid, mesg); + printf("pid %d: %s", p->p_pid, rout); + uprintf("sorry, pid %d was killed in %s", p->p_pid, rout); /* * To be sure no looping (e.g. in vmsched trying to * swap out) mark process locked in core (as though -- 2.20.1