Add minor stylistic changes
This commit is contained in:
parent
2a47637d5e
commit
69f002acd2
|
@ -812,8 +812,9 @@ int session;
|
|||
return ALLOWED;
|
||||
}
|
||||
|
||||
/* Check for exceeded time limits & logoff exceeders */
|
||||
void check_idle()
|
||||
{ /* Check for exceeded time limits & logoff exceeders */
|
||||
{
|
||||
char user[sizeof(utmpp->ut_user) + 1];
|
||||
char host[sizeof(utmpp->ut_host) + 1];
|
||||
struct stat status;
|
||||
|
@ -821,13 +822,14 @@ void check_idle()
|
|||
|
||||
if (utmpp->ut_type != USER_PROCESS || kill(utmpp->ut_pid, 0) == -1) /* if not user process, or if proc doesn't exist */
|
||||
return; /* skip the utmp entry */
|
||||
|
||||
strncpy(user, utmpp->ut_user, sizeof(user) - 1); /* get user name */
|
||||
user[sizeof(user) - 1] = '\0'; /* null terminate user name string */
|
||||
|
||||
strncpy(host, utmpp->ut_host, sizeof(host) - 1); /* get host name */
|
||||
host[sizeof(host) - 1] = '\0';
|
||||
strncpy(dev, utmpp->ut_line, sizeof(dev) - 1); /* get device name */
|
||||
dev[sizeof(dev) - 1] = '\0';
|
||||
|
||||
sprintf(path, "/dev/%s", dev);
|
||||
if (stat(path, &status) && chk_xsession(dev, host) != TIMEOUTD_XSESSION_LOCAL) { /* if can't get status for
|
||||
port && if it's not a local Xsession */
|
||||
|
|
Loading…
Reference in a new issue