diff --git a/timeoutd.c b/timeoutd.c index d168e7d..c684da5 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -858,8 +858,7 @@ void check_idle() pstat = &status; /* point to status structure */ sprintf(path, "/proc/%d", utmpp->ut_pid); - if (utmpp->ut_type != USER_PROCESS || !utmpp->ut_user[0] || /* if not user process */ - stat(path, pstat)) /* or if proc doesn't exist */ + if (utmpp->ut_type != USER_PROCESS || stat(path, pstat)) /* 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 */