**** Merged from Hardangervidda ****
1999-11-28 Martin Baulig <martin@home-of-linux.org> * procstate.c (glibtop_get_procstate_s): Stat "/proc/<pid>" instead of "/proc/<pid>/state" to get `uid' and `gid'. Thanks to Jason Becker for pointing out that GTop reported wrong uid's.
This commit is contained in:
committed by
Martin Baulig
parent
566e05bb33
commit
abb3ba2c6a
@@ -61,7 +61,7 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
|
||||
* values; NEVER set their flags values if this
|
||||
* is not the case !!! */
|
||||
|
||||
sprintf (buffer, "/proc/%d/stat", pid);
|
||||
sprintf (buffer, "/proc/%d", pid);
|
||||
|
||||
if (stat (buffer, &statb))
|
||||
return -1;
|
||||
@@ -74,6 +74,8 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
|
||||
|
||||
buf->flags = _glibtop_sysdeps_proc_state_uid;
|
||||
|
||||
sprintf (buffer, "/proc/%d", pid);
|
||||
|
||||
/* Now we read the remaining fields. */
|
||||
|
||||
if (proc_stat_to_buffer (buffer, pid))
|
||||
|
Reference in New Issue
Block a user