]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/tests/sdt.c
perf buildid: Move prototypes from util.h to build-id.h
[karo-tx-linux.git] / tools / perf / tests / sdt.c
index f59d210e1bafbe21f5689587b718a8fb04f252cc..06eda675ae2c1ee3a59758c00285dc1a1f793230 100644 (file)
@@ -1,6 +1,6 @@
+#include <errno.h>
 #include <stdio.h>
 #include <sys/epoll.h>
-#include <util/util.h>
 #include <util/evlist.h>
 #include <linux/filter.h>
 #include "tests.h"
@@ -43,7 +43,7 @@ static char *get_self_path(void)
 {
        char *buf = calloc(PATH_MAX, sizeof(char));
 
-       if (buf && readlink("/proc/self/exe", buf, PATH_MAX) < 0) {
+       if (buf && readlink("/proc/self/exe", buf, PATH_MAX - 1) < 0) {
                pr_debug("Failed to get correct path of perf\n");
                free(buf);
                return NULL;