[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bc424a36-24f6-3f52-5fdd-5d24cc209a6f@I-love.SAKURA.ne.jp>
Date: Tue, 7 Jun 2022 19:11:31 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
Sedat Dilek <sedat.dilek@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v2] kbuild: fix build failure by
scripts/check-local-export
On 2022/06/07 17:34, Masahiro Yamada wrote:
> This patch does not work because you did not avoid
> running the while-loop in a subshell.
>
> It is well described in this page:
> https://riptutorial.com/bash/example/26955/to-avoid-usage-of-a-sub-shell
>
I didn't know that. Then, adding below diff will work.
@@ -24,7 +24,7 @@ exit_code=0
# symbol_types is fine because export_symbols will remain empty.
result=$(${NM} ${1} 2>&1) || die "${result}"
-echo "${result}" | while read value type name
+while read value type name
do
# Skip the line if the number of fields is less than 3.
#
@@ -48,7 +48,9 @@ do
if [[ ${name} == __ksymtab_* ]]; then
export_symbols+=(${name#__ksymtab_})
fi
-done
+done <<EOF
+"${result}"
+EOF
for name in "${export_symbols[@]}"
do
>
>
> I will send a working patch with a proper commit log.
OK. "[PATCH] scripts/check-local-export: avoid 'wait $!' for process substitution" works.
Thank you.
Powered by blists - more mailing lists