summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/sprint.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-04-02 20:22:29 +0000
committerrwatson <rwatson@FreeBSD.org>2003-04-02 20:22:29 +0000
commit021eeb20207634119a2920f756b6eba04148bbf9 (patch)
treef72c83dc9edbf32b99a0125f281f577ae7fca0c8 /usr.bin/finger/sprint.c
parent7d92e4785f93cada96cb5d56ef4c5685d58884d9 (diff)
downloadFreeBSD-src-021eeb20207634119a2920f756b6eba04148bbf9.zip
FreeBSD-src-021eeb20207634119a2920f756b6eba04148bbf9.tar.gz
If stat() on the terminal specified in utmp fails due to ENOENT, don't
print a warning, and set the idletime variable for the entry to -1; then pick up the -1 later in sprint() and lprint() and ignore those idle times by printing just whitespace. When third party applications, such as kdm, insert utmp entries, they sometimes use strings like ":0", which can't be stat()'d and currently result in warnings that are not helpful to the user.
Diffstat (limited to 'usr.bin/finger/sprint.c')
-rw-r--r--usr.bin/finger/sprint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c
index 396c86e..51a1919 100644
--- a/usr.bin/finger/sprint.c
+++ b/usr.bin/finger/sprint.c
@@ -167,6 +167,11 @@ stimeprint(WHERE *w)
{
struct tm *delta;
+ if (w->idletime == -1) {
+ (void)printf(" ");
+ return;
+ }
+
delta = gmtime(&w->idletime);
if (!delta->tm_yday)
if (!delta->tm_hour)
OpenPOWER on IntegriCloud