diff options
author | Len Brown <len.brown@intel.com> | 2011-03-23 02:33:54 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-03-23 02:33:54 -0400 |
commit | 5c129a8600100a5d0f5fdbc1014c5dba1d307bc4 (patch) | |
tree | 9877a14b49cff43d0ba10c12f407ec551c77daa5 /tools/perf/util/header.c | |
parent | 797b10a07069e153d41aedb4ae8e76660279e2ee (diff) | |
parent | 521cb40b0c44418a4fd36dc633f575813d59a43d (diff) |
Merge commit 'v2.6.38' into release
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index f6a929e74981..0866bcdb5e8e 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -270,11 +270,15 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, | |||
270 | const char *name, bool is_kallsyms) | 270 | const char *name, bool is_kallsyms) |
271 | { | 271 | { |
272 | const size_t size = PATH_MAX; | 272 | const size_t size = PATH_MAX; |
273 | char *realname = realpath(name, NULL), | 273 | char *realname, *filename = malloc(size), |
274 | *filename = malloc(size), | ||
275 | *linkname = malloc(size), *targetname; | 274 | *linkname = malloc(size), *targetname; |
276 | int len, err = -1; | 275 | int len, err = -1; |
277 | 276 | ||
277 | if (is_kallsyms) | ||
278 | realname = (char *)name; | ||
279 | else | ||
280 | realname = realpath(name, NULL); | ||
281 | |||
278 | if (realname == NULL || filename == NULL || linkname == NULL) | 282 | if (realname == NULL || filename == NULL || linkname == NULL) |
279 | goto out_free; | 283 | goto out_free; |
280 | 284 | ||
@@ -306,7 +310,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, | |||
306 | if (symlink(targetname, linkname) == 0) | 310 | if (symlink(targetname, linkname) == 0) |
307 | err = 0; | 311 | err = 0; |
308 | out_free: | 312 | out_free: |
309 | free(realname); | 313 | if (!is_kallsyms) |
314 | free(realname); | ||
310 | free(filename); | 315 | free(filename); |
311 | free(linkname); | 316 | free(linkname); |
312 | return err; | 317 | return err; |