1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Fill in parent process id when reading process information from a

memory dump. This fixes one of the problems noted in PR kern/3581.
This commit is contained in:
Tor Egge 1997-06-25 20:56:48 +00:00
parent 91f7398bca
commit a58930d8a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26947

View File

@ -110,6 +110,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
struct session sess;
struct tty tty;
struct proc proc;
struct proc pproc;
for (; cnt < maxcnt && p != NULL; p = proc.p_list.le_next) {
if (KREAD(kd, (u_long)p, &proc)) {
@ -155,6 +156,17 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
proc.p_pgrp);
return (-1);
}
if (proc.p_oppid)
eproc.e_ppid = proc.p_oppid;
else if (proc.p_pptr) {
if (KREAD(kd, (u_long)proc.p_pptr, &pproc)) {
_kvm_err(kd, kd->program, "can't read pproc at %x",
proc.p_pptr);
return (-1);
}
eproc.e_ppid = pproc.p_pid;
} else
eproc.e_ppid = 0;
eproc.e_sess = pgrp.pg_session;
eproc.e_pgid = pgrp.pg_id;
eproc.e_jobc = pgrp.pg_jobc;