summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/w/w.c7
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
OpenPOWER on IntegriCloud