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
This commit is contained in:
parent
5eed5e140e
commit
2c6b9fc354
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user