From e94b4882b6fd509180e568b8f1cc7c9e9a453678 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 28 Nov 1999 11:57:11 +0000 Subject: [PATCH] **** Merged from Hardangervidda **** 1999-11-28 Martin Baulig * procstate.c (glibtop_get_procstate_s): Stat "/proc/" instead of "/proc//state" to get `uid' and `gid'. Thanks to Jason Becker for pointing out that GTop reported wrong uid's. --- sysdeps/linux/ChangeLog | 6 ++++++ sysdeps/linux/procstate.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 + + * procstate.c (glibtop_get_procstate_s): Stat "/proc/" instead + of "/proc//state" to get `uid' and `gid'. Thanks to Jason Becker + for pointing out that GTop reported wrong uid's. + 1999-10-19 Martin Baulig * 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))