From 8a0a3632ac2a37be9372d422e96480d57da5a150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Fri, 28 Sep 2007 17:32:59 +0000 Subject: [PATCH] Use fstat instead of stat. svn path=/trunk/; revision=2665 --- sysdeps/linux/proclist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/linux/proclist.c b/sysdeps/linux/proclist.c index 423865bd..eb8e8bd2 100644 --- a/sysdeps/linux/proclist.c +++ b/sysdeps/linux/proclist.c @@ -71,7 +71,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, proc = opendir ("/proc"); if (!proc) return NULL; - if(stat("/proc", &statb)) return NULL; + if(fstat(dirfd(proc), &statb) != 0) return NULL; pids = g_array_sized_new(FALSE, FALSE, sizeof(pid_t), statb.st_nlink);