diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2011-03-17 14:14:12 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2011-03-17 14:14:12 -0400 |
commit | 325d1605542960903c88409b199734a3d8fc6612 (patch) | |
tree | 9d8eeed393a3b5dcadd1ddb6b76634b464fd6bc7 /tools/perf/util/header.c | |
parent | 3c5ead52ed68406c0ee789024c4ae581be8bcee4 (diff) | |
parent | 521cb40b0c44418a4fd36dc633f575813d59a43d (diff) |
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
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; |