diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index a19674666b4e47d73602ac6bbf25207d1f0c5741..f7fb2587df693a2f5261812d101917cc3d3450bb 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -374,7 +374,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name, if (is_kallsyms) { if (copyfile("/proc/kallsyms", filename)) goto out_free; - } else if (link(realname, filename) && copyfile(name, filename)) + } else if (link(realname, filename) && errno != EEXIST && + copyfile(name, filename)) goto out_free; }