lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH v2] kbuild: fix build failure by scripts/check-local-export
From
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.

\
 
 \ /
  Last update: 2022-06-07 12:12    [W:0.184 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site