瀏覽代碼

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>
Adrian Hunter 11 年之前
父節點
當前提交
a6f6ae99f1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/perf/util/dso.c

+ 1 - 1
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);
 	int fd = __open_dso(dso, machine);
 
 
-	if (fd > 0) {
+	if (fd >= 0) {
 		dso__list_add(dso);
 		dso__list_add(dso);
 		/*
 		/*
 		 * Check if we crossed the allowed number
 		 * Check if we crossed the allowed number