1 From foo@baz Wed Aug 22 10:28:26 CEST 2018
2 From: Kim Phillips <kim.phillips@arm.com>
3 Date: Fri, 29 Jun 2018 12:46:52 -0500
4 Subject: perf llvm-utils: Remove bashism from kernel include fetch script
6 From: Kim Phillips <kim.phillips@arm.com>
8 [ Upstream commit f6432b9f65001651412dbc3589d251534822d4ab ]
10 Like system(), popen() calls /bin/sh, which may/may not be bash.
12 Script when run on dash and encounters the line, yields:
14 exit: Illegal number: -1
16 checkbashisms report on script content:
18 possible bashism (exit|return with negative status code):
21 Remove the bashism and use the more portable non-zero failure
24 Signed-off-by: Kim Phillips <kim.phillips@arm.com>
25 Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
26 Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
27 Cc: Jiri Olsa <jolsa@redhat.com>
28 Cc: Michael Petlan <mpetlan@redhat.com>
29 Cc: Namhyung Kim <namhyung@kernel.org>
30 Cc: Peter Zijlstra <peterz@infradead.org>
31 Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
32 Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
33 Link: http://lkml.kernel.org/r/20180629124652.8d0af7e2281fd3fd8262cacc@arm.com
34 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
35 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
36 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 tools/perf/util/llvm-utils.c | 6 +++---
39 1 file changed, 3 insertions(+), 3 deletions(-)
41 --- a/tools/perf/util/llvm-utils.c
42 +++ b/tools/perf/util/llvm-utils.c
43 @@ -254,16 +254,16 @@ static const char *kinc_fetch_script =
45 "if ! test -d \"$KBUILD_DIR\"\n"
50 "if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n"
55 "TMPDIR=`mktemp -d`\n"
56 "if test -z \"$TMPDIR\"\n"
61 "cat << EOF > $TMPDIR/Makefile\n"