diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-10 03:21:00 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-10 03:21:00 +0000 |
commit | ff2998acd8d7dd47cb849ba5efd6f2f2b46423af (patch) | |
tree | 7c5fe667dbfd41fa720d0690392d481119fa2530 /usr.bin/tmux | |
parent | 871b6512afed34a138792a3efbd3b870579c1c9e (diff) |
Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc now
that we've got name we want for the API we want
"ZAP!" deraadt@
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/procname.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/tmux/procname.c b/usr.bin/tmux/procname.c index 3deb562ea3e..3c02b85c2dc 100644 --- a/usr.bin/tmux/procname.c +++ b/usr.bin/tmux/procname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procname.c,v 1.6 2009/12/24 22:29:15 guenther Exp $ */ +/* $OpenBSD: procname.c,v 1.7 2011/04/10 03:20:59 guenther Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -34,11 +34,11 @@ #define is_stopped(p) \ ((p)->p_stat == SSTOP || (p)->p_stat == SZOMB || (p)->p_stat == SDEAD) -struct kinfo_proc2 *cmp_procs(struct kinfo_proc2 *, struct kinfo_proc2 *); +struct kinfo_proc *cmp_procs(struct kinfo_proc *, struct kinfo_proc *); char *get_proc_name(int, char *); -struct kinfo_proc2 * -cmp_procs(struct kinfo_proc2 *p1, struct kinfo_proc2 *p2) +struct kinfo_proc * +cmp_procs(struct kinfo_proc *p1, struct kinfo_proc *p2) { if (is_runnable(p1) && !is_runnable(p2)) return (p1); @@ -78,11 +78,11 @@ cmp_procs(struct kinfo_proc2 *p1, struct kinfo_proc2 *p2) char * get_proc_name(int fd, char *tty) { - int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PGRP, 0, - sizeof(struct kinfo_proc2), 0 }; + int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PGRP, 0, + sizeof(struct kinfo_proc), 0 }; struct stat sb; size_t len; - struct kinfo_proc2 *buf, *newbuf, *bestp; + struct kinfo_proc *buf, *newbuf, *bestp; u_int i; char *name; @@ -102,7 +102,7 @@ retry: goto error; buf = newbuf; - mib[5] = (int)(len / sizeof(struct kinfo_proc2)); + mib[5] = (int)(len / sizeof(struct kinfo_proc)); if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) == -1) { if (errno == ENOMEM) goto retry; @@ -110,7 +110,7 @@ retry: } bestp = NULL; - for (i = 0; i < len / sizeof (struct kinfo_proc2); i++) { + for (i = 0; i < len / sizeof (struct kinfo_proc); i++) { if ((dev_t)buf[i].p_tdev != sb.st_rdev) continue; if (bestp == NULL) |