summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1999-11-28 11:57:11 +0000
committerMartin Baulig <martin@src.gnome.org>1999-11-28 11:57:11 +0000
commite94b4882b6fd509180e568b8f1cc7c9e9a453678 (patch)
tree6d43dc0ea3d80d566f9cf16c0beddb374dd753a1
parent1e629c9a868a42a2cfcb295f672bc9db2e9d7895 (diff)
downloadlibgtop-e94b4882b6fd509180e568b8f1cc7c9e9a453678.tar.gz
**** 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.
-rw-r--r--sysdeps/linux/ChangeLog6
-rw-r--r--sysdeps/linux/procstate.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog
index 027795ff..db12dca1 100644
--- a/sysdeps/linux/ChangeLog
+++ b/sysdeps/linux/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
1999-10-19 Martin Baulig <martin@home-of-linux.org>
* uptime.c (glibtop_get_uptime_s): Don't cast uptime and idletime
diff --git a/sysdeps/linux/procstate.c b/sysdeps/linux/procstate.c
index 6bb8e5ae..39d93319 100644
--- a/sysdeps/linux/procstate.c
+++ b/sysdeps/linux/procstate.c
@@ -59,7 +59,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;
@@ -72,6 +72,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))