Use fstat instead of stat.

svn path=/trunk/; revision=2665
This commit is contained in:
Benoît Dejean
2007-09-28 17:32:59 +00:00
parent e6f9e07a9e
commit 8a0a3632ac

View File

@@ -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);