]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/perf-llvm-utils-remove-bashism-from-kernel-include-fetch-script.patch
Linux 4.9.124
[thirdparty/kernel/stable-queue.git] / queue-4.4 / perf-llvm-utils-remove-bashism-from-kernel-include-fetch-script.patch
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
5
6 From: Kim Phillips <kim.phillips@arm.com>
7
8 [ Upstream commit f6432b9f65001651412dbc3589d251534822d4ab ]
9
10 Like system(), popen() calls /bin/sh, which may/may not be bash.
11
12 Script when run on dash and encounters the line, yields:
13
14 exit: Illegal number: -1
15
16 checkbashisms report on script content:
17
18 possible bashism (exit|return with negative status code):
19 exit -1
20
21 Remove the bashism and use the more portable non-zero failure
22 status code 1.
23
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>
37 ---
38 tools/perf/util/llvm-utils.c | 6 +++---
39 1 file changed, 3 insertions(+), 3 deletions(-)
40
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 =
44 "#!/usr/bin/env sh\n"
45 "if ! test -d \"$KBUILD_DIR\"\n"
46 "then\n"
47 -" exit -1\n"
48 +" exit 1\n"
49 "fi\n"
50 "if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n"
51 "then\n"
52 -" exit -1\n"
53 +" exit 1\n"
54 "fi\n"
55 "TMPDIR=`mktemp -d`\n"
56 "if test -z \"$TMPDIR\"\n"
57 "then\n"
58 -" exit -1\n"
59 +" exit 1\n"
60 "fi\n"
61 "cat << EOF > $TMPDIR/Makefile\n"
62 "obj-y := dummy.o\n"