Blame SOURCES/bsd-finger-0.17-utmp.patch

d77ab8
--- bsd-finger-0.17/finger/finger.c.utmp	2004-06-15 11:38:24.000000000 -0400
d77ab8
+++ bsd-finger-0.17/finger/finger.c	2004-06-15 12:22:15.000000000 -0400
d77ab8
@@ -75,6 +75,8 @@
d77ab8
 #include <limits.h>
d77ab8
 #include <time.h>
d77ab8
 #include <getopt.h>
d77ab8
+#include <signal.h>
d77ab8
+#include <errno.h>
d77ab8
 #include "finger.h"
d77ab8
 #ifdef _USAGI
d77ab8
 #include "version.h"
d77ab8
@@ -224,6 +226,8 @@
d77ab8
 #ifdef USER_PROCESS
d77ab8
 		if (uptr->ut_type != USER_PROCESS) continue;
d77ab8
 #endif
d77ab8
+		if (kill(uptr->ut_pid, 0) < 0 && errno == ESRCH)
d77ab8
+			continue;
d77ab8
 		if ((pn = find_person(uptr->ut_name)) == NULL) {
d77ab8
 			memcpy(name, uptr->ut_name, UT_NAMESIZE);
d77ab8
 			if ((pw = getpwnam(name)) == NULL)
d77ab8
@@ -331,6 +335,8 @@
d77ab8
 #ifdef USER_PROCESS
d77ab8
 		if (uptr->ut_type != USER_PROCESS) continue;
d77ab8
 #endif
d77ab8
+		if (kill(uptr->ut_pid, 0) < 0 && errno == ESRCH)
d77ab8
+			continue;
d77ab8
 		if ((pn = find_person(uptr->ut_name)) == NULL) {
d77ab8
 			continue;
d77ab8
 		}
d77ab8
--- bsd-finger-0.17/finger/util.c.utmp	2004-06-15 11:38:24.000000000 -0400
d77ab8
+++ bsd-finger-0.17/finger/util.c	2004-06-15 11:38:24.000000000 -0400
d77ab8
@@ -71,6 +71,8 @@
d77ab8
 	}
d77ab8
 	snprintf(tbuf, TBUFLEN, "%s/%s", _PATH_DEV, w->tty);
d77ab8
 	if (stat(tbuf, &sb) < 0) {
d77ab8
+	    w->idletime = 0;  /* No tty no write, no idle data */
d77ab8
+	    w->writable = 0;
d77ab8
 	    switch (errno) {
d77ab8
 	    case ENOENT:
d77ab8
 		break;