summaryrefslogtreecommitdiff
path: root/tools/perf/util/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/path.c')
-rw-r--r--tools/perf/util/path.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 5d13cb4..a8c4954 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -22,23 +22,19 @@ static const char *get_perf_dir(void)
return ".";
}
-/*
- * If libc has strlcpy() then that version will override this
- * implementation:
- */
-size_t __weak strlcpy(char *dest, const char *src, size_t size)
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *dest, const char *src, size_t size)
{
size_t ret = strlen(src);
if (size) {
size_t len = (ret >= size) ? size - 1 : ret;
-
memcpy(dest, src, len);
dest[len] = '\0';
}
-
return ret;
}
+#endif
static char *get_pathname(void)
{