diff --git a/sysutils/whowatch/Makefile b/sysutils/whowatch/Makefile index f79ccb2766a..25cbc15c663 100644 --- a/sysutils/whowatch/Makefile +++ b/sysutils/whowatch/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.14 2010/11/20 17:22:42 espie Exp $ +# $OpenBSD: Makefile,v 1.15 2011/07/06 13:15:40 jasper Exp $ COMMENT= interactive utility that displays info about online users DISTNAME= whowatch-1.4 -REVISION = 1 +REVISION = 2 CATEGORIES= sysutils HOMEPAGE= http://wizard.ae.krakow.pl/~mike/ diff --git a/sysutils/whowatch/patches/patch-configure_in b/sysutils/whowatch/patches/patch-configure_in deleted file mode 100644 index 918d449cfac..00000000000 --- a/sysutils/whowatch/patches/patch-configure_in +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-configure_in,v 1.1 2010/01/18 12:07:45 sthen Exp $ ---- configure.in.orig Mon Jan 18 09:18:53 2010 -+++ configure.in Mon Jan 18 09:18:57 2010 -@@ -102,7 +102,7 @@ AC_TRY_COMPILE([#include - #include - #include ], - [ --int mib[]={CTL_KERN,KERN_PROC,KERN_PROC_PID,1}; -+int mib[]={CTL_KERN,KERN_PROC2,KERN_PROC_PID,1}; - int len; - sysctl(mib, 4, 0, &len, 0, 0); - ], diff --git a/sysutils/whowatch/patches/patch-procinfo_c b/sysutils/whowatch/patches/patch-procinfo_c index 0fd3e2900cc..81da0504bee 100644 --- a/sysutils/whowatch/patches/patch-procinfo_c +++ b/sysutils/whowatch/patches/patch-procinfo_c @@ -1,30 +1,19 @@ -$OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ ---- procinfo.c.orig Tue Jun 6 19:36:47 2000 -+++ procinfo.c Mon Jan 18 11:51:29 2010 -@@ -62,18 +62,18 @@ void get_info(int pid, struct procinfo *p) - p->exec_file[EXEC_FILE] = '\0'; - } +$OpenBSD: patch-procinfo_c,v 1.3 2011/07/06 13:15:40 jasper Exp $ +--- procinfo.c.orig Tue Jun 6 20:36:47 2000 ++++ procinfo.c Wed Jul 6 15:14:42 2011 +@@ -64,9 +64,9 @@ void get_info(int pid, struct procinfo *p) #else --int fill_kinfo(struct kinfo_proc *info, int pid) -+int fill_kinfo(struct kinfo_proc2 *info, int pid) + int fill_kinfo(struct kinfo_proc *info, int pid) { - int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid }; - int len = sizeof *info; - if(sysctl(mib, 4, info, &len, 0, 0) == -1) -+ int mib[] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, pid, sizeof (struct kinfo_proc2), 1 }; ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, sizeof (struct kinfo_proc), 1 }; + size_t len = sizeof *info; + if(sysctl(mib, 6, info, &len, 0, 0) == -1) return -1; return len?0:-1; } - - void get_info(int pid, struct procinfo *p) - { -- struct kinfo_proc info; -+ struct kinfo_proc2 info; - p->ppid = -1; - p->cterm = -1; - p->euid = -1; @@ -83,12 +83,12 @@ void get_info(int pid, struct procinfo *p) if(fill_kinfo(&info, pid) == -1) return; @@ -44,20 +33,18 @@ $OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ p->exec_file[EXEC_FILE] = '\0'; } #endif -@@ -123,9 +123,10 @@ int get_term(char *tty) +@@ -123,8 +123,9 @@ int get_term(char *tty) */ int get_login_pid(char *tty) { - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_TTY, 0}; - int len, t, el, i, pid, cndt = -1, l; -- struct kinfo_proc *info; -+ int mib[6] = {CTL_KERN, KERN_PROC2, KERN_PROC_TTY, 0, sizeof(struct kinfo_proc2), 0}; ++ int mib[6] = {CTL_KERN, KERN_PROC, KERN_PROC_TTY, 0, sizeof(struct kinfo_proc), 0}; + int t, el, i, pid, cndt = -1, l; + size_t len; -+ struct kinfo_proc2 *info; + struct kinfo_proc *info; struct procinfo p; - /* this is for ftp logins */ @@ -134,26 +135,27 @@ int get_login_pid(char *tty) if((t = get_term(tty)) == -1) return -1; @@ -67,9 +54,8 @@ $OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ return -1; info = calloc(1, len); if(!info) return -1; -- el = len/sizeof(struct kinfo_proc); + el = len/sizeof(struct kinfo_proc); - if(sysctl(mib, 4, info, &len, 0, 0) == -1) -+ el = len/sizeof(struct kinfo_proc2); + mib[5] = el; + if(sysctl(mib, 6, info, &len, NULL, 0) == -1) return -1; @@ -92,16 +78,13 @@ $OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ free(info); return pid; } -@@ -166,17 +168,18 @@ int get_login_pid(char *tty) - /* - * Get information about all system processes +@@ -168,15 +170,16 @@ int get_login_pid(char *tty) */ --int get_all_info(struct kinfo_proc **info) -+int get_all_info(struct kinfo_proc2 **info) + int get_all_info(struct kinfo_proc **info) { - int mib[3] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; - int len, el; -+ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), 0 }; ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), 0 }; + int el; + size_t len; @@ -112,19 +95,12 @@ $OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ if(!*info) return 0; - el = len/sizeof(struct kinfo_proc); - if(sysctl(mib, 3, *info, &len, 0, 0) == -1) -+ mib[5] = el = len/sizeof(struct kinfo_proc2); ++ mib[5] = el = len/sizeof(struct kinfo_proc); + if(sysctl(mib, 6, *info, &len, 0, 0) == -1) return 0; return el; } -@@ -233,17 +236,17 @@ int kvm_init() - char *get_cmdline(int pid) - { - static char buf[512]; -- struct kinfo_proc info; -+ struct kinfo_proc2 info; - - char **p, *s = buf; +@@ -239,7 +242,7 @@ char *get_cmdline(int pid) bzero(buf, sizeof buf); if(fill_kinfo(&info, pid) == -1) return "-"; @@ -133,8 +109,3 @@ $OpenBSD: patch-procinfo_c,v 1.2 2010/01/18 12:07:45 sthen Exp $ if(!full_cmd) return buf; #ifdef HAVE_LIBKVM if(!can_use_kvm) return buf; -- p = kvm_getargv(kd, &info, 0); -+ p = kvm_getargv2(kd, &info, 0); - if(!p) return buf; - for(; *p; p++) { - *s++ = ' '; diff --git a/sysutils/whowatch/patches/patch-proctree_c b/sysutils/whowatch/patches/patch-proctree_c index 2aec47b0989..eaa44cf0963 100644 --- a/sysutils/whowatch/patches/patch-proctree_c +++ b/sysutils/whowatch/patches/patch-proctree_c @@ -1,24 +1,6 @@ -$OpenBSD: patch-proctree_c,v 1.1 2010/01/18 12:07:45 sthen Exp $ +$OpenBSD: patch-proctree_c,v 1.2 2011/07/06 13:15:40 jasper Exp $ --- proctree.c.orig Mon Jan 18 11:36:53 2010 +++ proctree.c Mon Jan 18 11:52:10 2010 -@@ -41,7 +41,7 @@ - #define change_head(a,b,f) ({b=a; if(a) a->f.ppv=&b;}) - - #ifdef HAVE_PROCESS_SYSCTL --int get_all_info(struct kinfo_proc **); -+int get_all_info(struct kinfo_proc2 **); - #endif - - struct pinfo { -@@ -155,7 +155,7 @@ static inline void change_parent(struct proc_t* p,stru - int update_tree(void del(void*)) - { - #ifdef HAVE_PROCESS_SYSCTL -- struct kinfo_proc *pi; -+ struct kinfo_proc2 *pi; - int i, el; - #else - struct pinfo info; @@ -170,8 +170,8 @@ int update_tree(void del(void*)) #ifdef HAVE_PROCESS_SYSCTL el = get_all_info(&pi);