diff options
| author | Tony Lindgren <tony@atomide.com> | 2010-08-02 14:23:38 +0300 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2010-08-02 14:23:38 +0300 |
| commit | 055a1b8c9927bc587f293020a54c6cd8e24dfac0 (patch) | |
| tree | db7c8d00931180c4896c9e00d2cb506939592cda /tools/perf/util/thread.c | |
| parent | 8a6f7e14fc3b3ea911838c3f4ce137cb8a3d134a (diff) | |
| parent | f535daed925c2d3c1db06b06a63c4955f2c51988 (diff) | |
Merge branch 'devel-misc' into omap-for-linus
Diffstat (limited to 'tools/perf/util/thread.c')
| -rw-r--r-- | tools/perf/util/thread.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 1f7ecd47f49..9a448b47400 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -7,6 +7,15 @@ #include "util.h" #include "debug.h" +/* Skip "." and ".." directories */ +static int filter(const struct dirent *dir) +{ + if (dir->d_name[0] == '.') + return 0; + else + return 1; +} + int find_all_tid(int pid, pid_t ** all_tid) { char name[256]; @@ -16,7 +25,7 @@ int find_all_tid(int pid, pid_t ** all_tid) int i; sprintf(name, "/proc/%d/task", pid); - items = scandir(name, &namelist, NULL, NULL); + items = scandir(name, &namelist, filter, NULL); if (items <= 0) return -ENOENT; *all_tid = malloc(sizeof(pid_t) * items); |
