Remove getusr function
This function was only used to check if the special case for ssh ended up properly, since it's not a special case anymore, the function isn't called anywhere, and has been removed.
This commit is contained in:
parent
42731b5ced
commit
5469d5ec00
19
timeoutd.c
19
timeoutd.c
|
@ -96,7 +96,6 @@ void logoff_msg();
|
||||||
void killit();
|
void killit();
|
||||||
int chk_xsession(); /* seppy: is it a X-Session? */
|
int chk_xsession(); /* seppy: is it a X-Session? */
|
||||||
void killit_xsession(); /* seppy: kill the X-Session */
|
void killit_xsession(); /* seppy: kill the X-Session */
|
||||||
char *getusr(pid_t pid); /*seppy: get the owner of a running process */
|
|
||||||
void segfault(); /* seppy: catch segfault and log them */
|
void segfault(); /* seppy: catch segfault and log them */
|
||||||
int chk_xterm(); /* seppy: is it a xterm? */
|
int chk_xterm(); /* seppy: is it a xterm? */
|
||||||
|
|
||||||
|
@ -1129,24 +1128,6 @@ char *host, *user;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char *getusr(pid) /*seppy; returns the name of the user owning process with the Process ID pid */
|
|
||||||
pid_t pid;
|
|
||||||
{
|
|
||||||
char uid[99];
|
|
||||||
sprintf(path, "/proc/%d/status", pid);
|
|
||||||
proc_file = fopen(path, "r");
|
|
||||||
if (!proc_file) {
|
|
||||||
syslog(LOG_NOTICE, "getusr(): PID %d does not exist. Ignoring.", pid);
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
while (!fscanf(proc_file, "Uid: %s", uid))
|
|
||||||
fgets(uid, 98, proc_file);
|
|
||||||
fclose(proc_file);
|
|
||||||
return getpwuid(atoi(uid))->pw_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef TIMEOUTDX11
|
#ifdef TIMEOUTDX11
|
||||||
Time get_xidle(user, display) /*seppy; returns millicecs since last input event */
|
Time get_xidle(user, display) /*seppy; returns millicecs since last input event */
|
||||||
char *user;
|
char *user;
|
||||||
|
|
Loading…
Reference in a new issue