Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <
1256592199-9608-1-git-send-email-acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
fp = fopen(filename, "r");
if (fp == NULL) {
+out_race:
/*
* We raced with a task exiting - just return:
*/
snprintf(filename, sizeof(filename), "/proc/%d/task", pid);
tasks = opendir(filename);
+ if (tasks == NULL)
+ goto out_race;
+
while (!readdir_r(tasks, &dirent, &next) && next) {
char *end;
pid = strtol(dirent.d_name, &end, 10);