Removed last use of /proc
In the last several commits, all uses of the /proc virtual file system have been removed, intentionally in some places, unintentionally in others. Now I've finished that job, hopefully this will make it easier to port the program on systems which don't support procfs by default, such as FreeBSD and OpenBSD.
This commit is contained in:
parent
5469d5ec00
commit
097a93441b
|
@ -823,8 +823,7 @@ void check_idle()
|
|||
struct stat status;
|
||||
time_t idle, sesstime;
|
||||
|
||||
sprintf(path, "/proc/%d", utmpp->ut_pid);
|
||||
if (utmpp->ut_type != USER_PROCESS || stat(path, &status)) /* if not user process, or if proc doesn't exist */
|
||||
if (utmpp->ut_type != USER_PROCESS || kill(utmpp->ut_pid, 0)) /* 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 */
|
||||
|
|
Loading…
Reference in a new issue