]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/util/path.c
manual merge of x86/reboot
[karo-tx-linux.git] / tools / perf / util / path.c
index a8c49548ca48f5bc4f7ae14134ee57d7779b46e8..5d13cb45b3171a98a171b0f7228d1fff470bf8c0 100644 (file)
@@ -22,19 +22,23 @@ static const char *get_perf_dir(void)
        return ".";
 }
 
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dest, const char *src, size_t size)
+/*
+ * If libc has strlcpy() then that version will override this
+ * implementation:
+ */
+size_t __weak 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)
 {