diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2007-09-28 17:30:31 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2007-09-28 17:30:31 +0000 |
commit | e6f9e07a9eb20679f6b77cc68559a6d62f8773c5 (patch) | |
tree | 945158e956805f52ea3b72683f7b090a48c470ae | |
parent | 755695c537db259ef112e3386ed6827ff9b98ccf (diff) | |
download | libgtop-e6f9e07a9eb20679f6b77cc68559a6d62f8773c5.tar.gz |
"." is not a tid.
svn path=/trunk/; revision=2664
-rw-r--r-- | sysdeps/linux/procwd.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)); |