From e6f9e07a9eb20679f6b77cc68559a6d62f8773c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Fri, 28 Sep 2007 17:30:31 +0000 Subject: [PATCH] "." is not a tid. svn path=/trunk/; revision=2664 --- sysdeps/linux/procwd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdeps/linux/procwd.c b/sysdeps/linux/procwd.c index 9a79085f..8faecb07 100644 --- a/sysdeps/linux/procwd.c +++ b/sysdeps/linux/procwd.c @@ -79,6 +79,9 @@ glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) if ((task = opendir(path)) != NULL) { struct dirent *sub; while ((sub = readdir(task)) != NULL) { + /* task dirs have numeric name */ + if (!isdigit(sub->d_name[0])) + continue; g_snprintf(path, sizeof path, "/proc/%u/task/%s/cwd", pid, sub->d_name); if (safe_readlink(path, dir, sizeof dir) && !is_in(dirs, dir)) g_ptr_array_add(dirs, g_strdup(dir));