mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
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
79458607f6
commit
d0d0355e4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102300
@ -491,11 +491,10 @@ ttystat(char *line, int sz)
|
|||||||
char ttybuf[MAXPATHLEN];
|
char ttybuf[MAXPATHLEN];
|
||||||
|
|
||||||
(void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line);
|
(void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line);
|
||||||
if (stat(ttybuf, &sb)) {
|
if (stat(ttybuf, &sb) == 0) {
|
||||||
warn("%s", ttybuf);
|
return (&sb);
|
||||||
|
} else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
|
||||||
return (&sb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user