diff options
author | seanc <seanc@FreeBSD.org> | 2002-08-23 04:31:58 +0000 |
---|---|---|
committer | seanc <seanc@FreeBSD.org> | 2002-08-23 04:31:58 +0000 |
commit | ad6e76463238a2baf48c1a7a91639c53faa4b391 (patch) | |
tree | bff748bba2d18e29c482fa65dadf5f77f5c97c93 /usr.bin/w | |
parent | e528806f994ecb3c23bf174011c94e71abaf5073 (diff) | |
download | FreeBSD-src-ad6e76463238a2baf48c1a7a91639c53faa4b391.zip FreeBSD-src-ad6e76463238a2baf48c1a7a91639c53faa4b391.tar.gz |
Fix warning when calling w(1) when logged in via xdm/kdm. This is
really a problem with utmp/wtmp, but takes the same approach as who(1).
Reviewed by: knu (mentor), mini, silence on -audit
Approved by: knu (mentor), mini
Diffstat (limited to 'usr.bin/w')
-rw-r--r-- | usr.bin/w/w.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index e93630f..7d3907b 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -491,11 +491,10 @@ ttystat(char *line, int sz) char ttybuf[MAXPATHLEN]; (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); - if (stat(ttybuf, &sb)) { - warn("%s", ttybuf); + if (stat(ttybuf, &sb) == 0) { + return (&sb); + } else return (NULL); - } - return (&sb); } static void |