From owner-freebsd-bugs Sun Jan 11 16:50:22 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA26864 for bugs-outgoing; Sun, 11 Jan 1998 16:50:22 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA26802; Sun, 11 Jan 1998 16:50:02 -0800 (PST) (envelope-from gnats) Date: Sun, 11 Jan 1998 16:50:02 -0800 (PST) Message-Id: <199801120050.QAA26802@hub.freebsd.org> To: freebsd-bugs Cc: From: Steve Price Subject: Re: bin/2832: w treats corrupted utmp as fatal error Reply-To: Steve Price Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/2832; it has been noted by GNATS. From: Steve Price To: freebsd-gnats-submit@freebsd.org, fenner@parc.xerox.com Cc: Subject: Re: bin/2832: w treats corrupted utmp as fatal error Date: Sun, 11 Jan 1998 18:44:48 -0600 --- w.c.orig Fri Feb 28 11:10:06 1997 +++ w.c Fri Feb 28 11:11:28 1997 @@ -438,7 +438,7 @@ (void)snprintf(ttybuf, sizeof(ttybuf), "%s/%s", _PATH_DEV, line); if (stat(ttybuf, &sb)) - err(1, "%s", ttybuf); + warn("%s", ttybuf); return (&sb); } After the stat(2) fails the contents of 'sb' should be considered indeterminate. Since the code goes on to use the sb.st_rdev member, I would say this is a fatal error and not just a warning if the stat(2) fails. Would you care to rework w(1) to not use the return value from ttystat() if the stat(2) fails? Steve