perf symbols: Fix random fd closing with no libelf
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 4 Dec 2013 14:23:01 +0000 (16:23 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 4 Dec 2013 18:08:19 +0000 (15:08 -0300)
When built without libelf, perf tools was failing to initialize a file
descriptor, but nevertheless closing it.  That sometimes resulted in the
output being truncated because the stdout file descriptor got closed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1386166981-30197-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-minimal.c

index 2d2dd05..ac7070a 100644 (file)
@@ -253,6 +253,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
        if (!ss->name)
                goto out_close;
 
+       ss->fd = fd;
        ss->type = type;
 
        return 0;