From: Adrian Hunter Date: Thu, 17 Jul 2014 08:43:09 +0000 (+0300) Subject: perf tools: Fix incorrect fd error comparison X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a6f6ae99f12e8154d5cde6e8366fc228f68d6ae5;p=linux-beck.git perf tools: Fix incorrect fd error comparison Zero is a valid fd. Error comparison should check for negative fd. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1405586590-13657-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index fc006fed8877..28cf7476b68c 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -216,7 +216,7 @@ static int open_dso(struct dso *dso, struct machine *machine) { int fd = __open_dso(dso, machine); - if (fd > 0) { + if (fd >= 0) { dso__list_add(dso); /* * Check if we crossed the allowed number