]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf tools: Fixup get_current_dir_name() compilation
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 17 Aug 2021 11:58:33 +0000 (14:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Oct 2022 05:54:36 +0000 (07:54 +0200)
commit c5f49e6200cbd168ee69e7f2d50cc77c3d336a87 upstream.

strdup() prototype doesn't live in stdlib.h .

Add limits.h for PATH_MAX definition as well.

This fixes the build on Android.

Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/YRukaQbrgDWhiwGr@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/perf/util/get_current_dir_name.c

index b205d929245f5ee9e54bfe65ee37dcc62bf5469a..e68935e9ac8ceeb37151e558d2bc546f84473006 100644 (file)
@@ -3,8 +3,9 @@
 //
 #ifndef HAVE_GET_CURRENT_DIR_NAME
 #include "get_current_dir_name.h"
+#include <limits.h>
+#include <string.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 /* Android's 'bionic' library, for one, doesn't have this */