Commit a6f6ae99f12e8154d5cde6e8366fc228f68d6ae5

Authored by Adrian Hunter
Committed by Arnaldo Carvalho de Melo
1 parent 2336ebc326

perf tools: Fix incorrect fd error comparison

Zero is a valid fd.  Error comparison should check for negative fd.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1405586590-13657-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

tools/perf/util/dso.c
... ... @@ -216,7 +216,7 @@
216 216 {
217 217 int fd = __open_dso(dso, machine);
218 218  
219   - if (fd > 0) {
  219 + if (fd >= 0) {
220 220 dso__list_add(dso);
221 221 /*
222 222 * Check if we crossed the allowed number