perf tools: Fix incorrect fd error comparison
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 17 Jul 2014 08:43:09 +0000 (11:43 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 Jul 2014 13:18:57 +0000 (10:18 -0300)
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>
tools/perf/util/dso.c

index fc006fed8877c6bc6c8dad239f607bb4a7770f76..28cf7476b68c0f1fb0dd6b97f03196c99ddcd2c1 100644 (file)
@@ -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