aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/tests/dso-data.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index 3e6cb171e3d3..738438196d9a 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -12,11 +12,15 @@
12 12
13static char *test_file(int size) 13static char *test_file(int size)
14{ 14{
15 static char buf_templ[] = "/tmp/test-XXXXXX"; 15#define TEMPL "/tmp/perf-test-XXXXXX"
16 static char buf_templ[sizeof(TEMPL)];
16 char *templ = buf_templ; 17 char *templ = buf_templ;
17 int fd, i; 18 int fd, i;
18 unsigned char *buf; 19 unsigned char *buf;
19 20
21 strcpy(buf_templ, TEMPL);
22#undef TEMPL
23
20 fd = mkstemp(templ); 24 fd = mkstemp(templ);
21 if (fd < 0) { 25 if (fd < 0) {
22 perror("mkstemp failed"); 26 perror("mkstemp failed");