diff options
Diffstat (limited to 'lib/libkvm/kvm_proc.c')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index bc4952e..6b29d40 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -116,7 +116,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) &eproc.e_ucred); switch(what) { - + case KERN_PROC_PID: if (proc.p_pid != (pid_t)arg) continue; @@ -154,7 +154,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) eproc.e_pgid = pgrp.pg_id; eproc.e_jobc = pgrp.pg_jobc; if (KREAD(kd, (u_long)pgrp.pg_session, &sess)) { - _kvm_err(kd, kd->program, "can't read session at %x", + _kvm_err(kd, kd->program, "can't read session at %x", pgrp.pg_session); return (-1); } @@ -169,7 +169,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) if (tty.t_pgrp != NULL) { if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) { _kvm_err(kd, kd->program, - "can't read tpgrp at &x", + "can't read tpgrp at &x", tty.t_pgrp); return (-1); } @@ -182,7 +182,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) if (sess.s_leader == p) eproc.e_flag |= EPROC_SLEADER; if (proc.p_wmesg) - (void)kvm_read(kd, (u_long)proc.p_wmesg, + (void)kvm_read(kd, (u_long)proc.p_wmesg, eproc.e_wmesg, WMESGLEN); #ifdef sparc @@ -207,7 +207,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) break; case KERN_PROC_TTY: - if ((proc.p_flag & P_CONTROLT) == 0 || + if ((proc.p_flag & P_CONTROLT) == 0 || eproc.e_tdev != (dev_t)arg) continue; break; @@ -265,7 +265,7 @@ kvm_getprocs(kd, op, arg, cnt) if (kd->procbase != 0) { free((void *)kd->procbase); - /* + /* * Clear this pointer in case this call fails. Otherwise, * kvm_close() will free it again. */ @@ -361,7 +361,7 @@ _kvm_realloc(kd, p, n) /* * Read in an argument vector from the user address space of process p. - * addr is the user-space base address of narg null-terminated contiguous + * addr is the user-space base address of narg null-terminated contiguous * strings. This is used to read in both the command arguments and * environment strings. Read at most maxcnt characters of strings. */ @@ -389,13 +389,13 @@ kvm_argv(kd, p, addr, narg, maxcnt) * Try to avoid reallocs. */ kd->argc = MAX(narg + 1, 32); - kd->argv = (char **)_kvm_malloc(kd, kd->argc * + kd->argv = (char **)_kvm_malloc(kd, kd->argc * sizeof(*kd->argv)); if (kd->argv == 0) return (0); } else if (narg + 1 > kd->argc) { kd->argc = MAX(2 * kd->argc, narg + 1); - kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * + kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * sizeof(*kd->argv)); if (kd->argv == 0) return (0); @@ -505,7 +505,7 @@ proc_verify(kd, kernp, p) * Just read in the whole proc. It's not that big relative * to the cost of the read system call. */ - if (kvm_read(kd, kernp, (char *)&kernproc, sizeof(kernproc)) != + if (kvm_read(kd, kernp, (char *)&kernproc, sizeof(kernproc)) != sizeof(kernproc)) return (0); return (p->p_pid == kernproc.p_pid && @@ -528,7 +528,7 @@ kvm_doargv(kd, kp, nchr, info) /* * Pointers are stored at the top of the user stack. */ - if (p->p_stat == SZOMB || + if (p->p_stat == SZOMB || kvm_uread(kd, p, USRSTACK - sizeof(arginfo) - SPARE_USRSPACE, (char *)&arginfo, sizeof(arginfo)) != sizeof(arginfo)) return (0); @@ -592,7 +592,7 @@ kvm_uread(kd, p, uva, buf, len) return (0); } - + while (len > 0) { if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) { _kvm_err(kd, kd->program, "invalid address (%x) in %s", uva, procfile); |