diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-23 14:25:02 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-23 14:27:33 -0400 |
commit | cf47a8aede9febee21cbd21d40a9c47244773a6c (patch) | |
tree | 954ece73f022c29ef84e08d39cf10a275c8b3a39 /tools/perf/util/path.c | |
parent | 531d2410635ce290bee215f4bf9ec8ca98cf7302 (diff) |
perf tools: Remove unused perf_pathdup, xstrdup functions
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-s87zi5d03m6rz622y1z6rlsa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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; |