diff options
| author | Thomas Zimmermann <[email protected]> | 2023-01-31 14:18:33 +0100 |
|---|---|---|
| committer | Thomas Zimmermann <[email protected]> | 2023-01-31 14:18:33 +0100 |
| commit | df5bf3b942a8d344bd9cbbe6ac31c9a2ea1557a4 (patch) | |
| tree | bfbcbe56b9f4f8b1e44242b80800a68b2ae5b2d6 /tools/perf/util/build-id.c | |
| parent | 532a38292c7213aa6d950e6a1b86659d08b5aa67 (diff) | |
| parent | aebd8f0c6f8280ba35bc989f4a9ea47469d3589a (diff) | |
Merge drm/drm-next into drm-misc-next
Backmerging to get v6.2-rc6.
Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'tools/perf/util/build-id.c')
| -rw-r--r-- | tools/perf/util/build-id.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index a839b30c981b..ea9c083ab1e3 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -715,9 +715,13 @@ build_id_cache__add(const char *sbuild_id, const char *name, const char *realnam } else if (nsi && nsinfo__need_setns(nsi)) { if (copyfile_ns(name, filename, nsi)) goto out_free; - } else if (link(realname, filename) && errno != EEXIST && - copyfile(name, filename)) - goto out_free; + } else if (link(realname, filename) && errno != EEXIST) { + struct stat f_stat; + + if (!(stat(name, &f_stat) < 0) && + copyfile_mode(name, filename, f_stat.st_mode)) + goto out_free; + } } /* Some binaries are stripped, but have .debug files with their symbol |