From 311fe03ec82296b1c0f98c1ba020420ee74b714a Mon Sep 17 00:00:00 2001 From: Petar Kapris Date: Fri, 18 Dec 2020 15:50:29 +0100 Subject: [PATCH] Print tty stat fail message to syslog In check_idle there is an sprintf call which copies an error message to the global variable errmsg, after which, absolutely nothing was done with the variable. From a piece of commented out code underneath, one can tell that this line used to have a purpose, as it was used in a bailout call, where it gets printed to the syslog. This call is deleted and now the errmsg string is simply written to and then never used. Now the line has been modified so the error message gets written to the syslog, removing the need for the errmsg variable. --- timeoutd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/timeoutd.c b/timeoutd.c index 310c6f0..632a73a 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -869,8 +869,7 @@ void check_idle() sprintf(path, "/dev/%s", dev); if (stat(path, pstat) && chk_xsession(dev, host) != TIMEOUTD_XSESSION_LOCAL) { /* if can't get status for port && if it's not a local Xsession */ - sprintf(errmsg, "Can't get status of user %s's terminal (%s)\n", user, dev); - /* bailout(errmsg, 1); MOH: is there a reason to exit here? */ + syslog(LOG_ERR, "Can't get status of user %s's terminal (%s)\n", user, dev); return; } /* idle time is the lesser of: