linux/Documentation/process
Masahiro Yamada da4288b95b scripts/check-local-export: avoid 'wait $!' for process substitution
Bash 4.4, released in 2016, supports 'wait $!' to check the exit status
of a process substitution, but it seems too new.

Some people using older bash versions (on CentOS 7, Ubuntu 16.04, etc.)
reported an error like this:

  ./scripts/check-local-export: line 54: wait: pid 17328 is not a child of this shell

I used the process substitution to avoid a pipeline, which executes each
command in a subshell. If the while-loop is executed in the subshell
context, variable changes within are lost after the subshell terminates.

Fortunately, Bash 4.2, released in 2011, supports the 'lastpipe' option,
which makes the last element of a pipeline run in the current shell process.

Switch to the pipeline with 'lastpipe' solution, and also set 'pipefail'
to catch errors from ${NM}.

Add the bash requirement to Documentation/process/changes.rst.

Fixes: 31cb50b559 ("kbuild: check static EXPORT_SYMBOL* by script instead of modpost")
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2022-06-10 03:47:13 +09:00
..
1.Intro.rst
2.Process.rst
3.Early-stage.rst Documentation/process: use scripts/get_maintainer.pl on patches 2022-05-09 16:12:16 -06:00
4.Coding.rst
5.Posting.rst
6.Followthrough.rst
7.AdvancedTopics.rst
8.Conclusion.rst
adding-syscalls.rst
applying-patches.rst Documentation: describe how to apply incremental stable patches 2022-03-09 16:29:44 -07:00
botching-up-ioctls.rst
changes.rst scripts/check-local-export: avoid 'wait $!' for process substitution 2022-06-10 03:47:13 +09:00
clang-format.rst
code-of-conduct-interpretation.rst
code-of-conduct.rst
coding-style.rst
deprecated.rst
development-process.rst
email-clients.rst
embargoed-hardware-issues.rst Documentation/process: Update ARM contact for embargoed hardware issues 2022-05-10 19:10:16 +02:00
handling-regressions.rst docs: *-regressions.rst: explain how quickly issues should be handled 2022-02-24 12:57:25 -07:00
howto.rst
index.rst Documentation/process: Add Researcher Guidelines 2022-03-09 16:19:23 -07:00
kernel-docs.rst
kernel-driver-statement.rst
kernel-enforcement-statement.rst
license-rules.rst
magic-number.rst
maintainer-handbooks.rst docs: netdev: move the netdev-FAQ to the process pages 2022-03-31 10:49:39 +02:00
maintainer-netdev.rst docs: netdev: move the netdev-FAQ to the process pages 2022-03-31 10:49:39 +02:00
maintainer-pgp-guide.rst
maintainer-tip.rst x86/configs: Add x86 debugging Kconfig fragment plus docs 2022-04-06 19:56:29 +02:00
maintainers.rst
management-style.rst
programming-language.rst Kbuild: move to -std=gnu11 2022-03-13 17:31:37 +09:00
researcher-guidelines.rst Documentation/process: Add Researcher Guidelines 2022-03-09 16:19:23 -07:00
stable-api-nonsense.rst
stable-kernel-rules.rst Documentation: update stable review cycle documentation 2022-03-18 14:32:49 +01:00
submit-checklist.rst
submitting-drivers.rst
submitting-patches.rst Documentation/process: use scripts/get_maintainer.pl on patches 2022-05-09 16:12:16 -06:00
volatile-considered-harmful.rst