Subject: bin/2289: w should use errx instead of err
To: None <gnats-bugs@NetBSD.ORG>
From: None <kashmir@umiacs.UMD.EDU>
List: netbsd-bugs
Date: 04/02/1996 08:33:15
>Number:         2289
>Category:       bin
>Synopsis:       w calls err when errno is not valid
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr  2 08:50:02 1996
>Originator:     Mike Grupenhoff
>Release:        -current of 3/26/96
System: NetBSD 1.1B NetBSD 1.1B (SNARF) #65: Mon Apr 1 23:20:12 EST 1996 i386

	When kvm_getprocs() returns null in w, w uses err() to report
	the error.  However, errno contains nothing usefull.
	Run a kernel with a w that have different ideas of what struct
	proc looks like.  Notce the error message produced has
	"Undefined error 0" appended.
Index: w.c
RCS file: /snarf/netbsd/master/src/usr.bin/w/w.c,v
retrieving revision
diff -u -r1.1.1.1 w.c
--- w.c	1995/11/16 02:28:51
+++ w.c	1996/04/02 01:37:18
@@ -222,7 +222,7 @@
 	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
-		err(1, "%s", kvm_geterr(kd));
+		errx(1, "%s", kvm_geterr(kd));
 	for (i = 0; i < nentries; i++, kp++) {
 		struct proc *p = &kp->kp_proc;
 		struct eproc *e;