Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 1998 16:50:02 -0800 (PST)
From:      Steve Price <sprice@hiwaay.net>
To:        freebsd-bugs
Subject:   Re: bin/2832: w treats corrupted utmp as fatal error
Message-ID:  <199801120050.QAA26802@hub.freebsd.org>

index | next in thread | raw e-mail

The following reply was made to PR bin/2832; it has been noted by GNATS.

From: Steve Price <sprice@hiwaay.net>
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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801120050.QAA26802>