diff options
Diffstat (limited to 'tools/perf/util/path.c')
-rw-r--r-- | tools/perf/util/path.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c index 3654d964e49d..3bf6bf82ff2d 100644 --- a/tools/perf/util/path.c +++ b/tools/perf/util/path.c | |||
@@ -41,36 +41,6 @@ static char *cleanup_path(char *path) | |||
41 | return path; | 41 | return path; |
42 | } | 42 | } |
43 | 43 | ||
44 | static char *perf_vsnpath(char *buf, size_t n, const char *fmt, va_list args) | ||
45 | { | ||
46 | const char *perf_dir = get_perf_dir(); | ||
47 | size_t len; | ||
48 | |||
49 | len = strlen(perf_dir); | ||
50 | if (n < len + 1) | ||
51 | goto bad; | ||
52 | memcpy(buf, perf_dir, len); | ||
53 | if (len && !is_dir_sep(perf_dir[len-1])) | ||
54 | buf[len++] = '/'; | ||
55 | len += vsnprintf(buf + len, n - len, fmt, args); | ||
56 | if (len >= n) | ||
57 | goto bad; | ||
58 | return cleanup_path(buf); | ||
59 | bad: | ||
60 | strlcpy(buf, bad_path, n); | ||
61 | return buf; | ||
62 | } | ||
63 | |||
64 | char *perf_pathdup(const char *fmt, ...) | ||
65 | { | ||
66 | char path[PATH_MAX]; | ||
67 | va_list args; | ||
68 | va_start(args, fmt); | ||
69 | (void)perf_vsnpath(path, sizeof(path), fmt, args); | ||
70 | va_end(args); | ||
71 | return xstrdup(path); | ||
72 | } | ||
73 | |||
74 | char *mkpath(const char *fmt, ...) | 44 | char *mkpath(const char *fmt, ...) |
75 | { | 45 | { |
76 | va_list args; | 46 | va_list args; |