summaryrefslogtreecommitdiff
path: root/sysdeps/linux
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2005-12-15 13:04:04 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2005-12-15 13:04:04 +0000
commit3afe2bf6297b8ddd87cc9d244dc666fb884a2202 (patch)
tree933530a331c058df48bc5a99559a764bae7aa170 /sysdeps/linux
parente296c3a37affe297ebf2aed33251802adfe1d4ef (diff)
downloadlibgtop-3afe2bf6297b8ddd87cc9d244dc666fb884a2202.tar.gz
Fixed when which == GLIBTOP_KERN_PROC_UID. Closes #324055.
* proclist.c: (glibtop_get_proclist_s): Fixed when which == GLIBTOP_KERN_PROC_UID. Closes #324055.
Diffstat (limited to 'sysdeps/linux')
-rw-r--r--sysdeps/linux/ChangeLog7
-rw-r--r--sysdeps/linux/proclist.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog
index aeb3bb6c..674696ce 100644
--- a/sysdeps/linux/ChangeLog
+++ b/sysdeps/linux/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-15 Benoît Dejean <benoit@placenet.org>
+
+ * proclist.c: (glibtop_get_proclist_s):
+
+ Fixed when which == GLIBTOP_KERN_PROC_UID.
+ Closes #324055.
+
2005-12-14 Benoît Dejean <benoit@placenet.org>
* open.c: (glibtop_open_s):
diff --git a/sysdeps/linux/proclist.c b/sysdeps/linux/proclist.c
index 6e5f48ab..7093afa0 100644
--- a/sysdeps/linux/proclist.c
+++ b/sysdeps/linux/proclist.c
@@ -98,8 +98,18 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
continue;
break;
case GLIBTOP_KERN_PROC_UID:
- if ((uid_t) arg != statb.st_uid)
+ {
+ char path[32];
+ struct stat path_stat;
+
+ snprintf(path, sizeof path, "/proc/%u", pid);
+
+ if (stat(path, &path_stat))
continue;
+
+ if ((uid_t) arg != path_stat.st_uid)
+ continue;
+ }
break;
case GLIBTOP_KERN_PROC_PGRP:
/* Do you really, really need this ? */