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 Documentation: process: step 2: Link to email list fixed. 2020-09-03 10:31:03 -06:00
3.Early-stage.rst Documentation/process: use scripts/get_maintainer.pl on patches 2022-05-09 16:12:16 -06:00
4.Coding.rst doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line 2021-02-22 13:59:10 -07:00
5.Posting.rst docs: 5.Posting.rst: describe Fixes: and Link: tags 2022-01-07 09:33:13 -07:00
6.Followthrough.rst
7.AdvancedTopics.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
8.Conclusion.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
adding-syscalls.rst docs: Make syscalls' helpers naming consistent 2021-02-04 14:47:24 -07:00
applying-patches.rst Documentation: describe how to apply incremental stable patches 2022-03-09 16:29:44 -07:00
botching-up-ioctls.rst Replace HTTP links with HTTPS ones: Documentation/process 2020-06-26 11:19:43 -06:00
changes.rst scripts/check-local-export: avoid 'wait $!' for process substitution 2022-06-10 03:47:13 +09:00
clang-format.rst Documentation: fix typos found in process, dev-tools, and doc-guide subdirectories 2020-12-03 15:55:04 -07:00
code-of-conduct-interpretation.rst
code-of-conduct.rst
coding-style.rst coding-style.rst: trivial: fix location of driver model macros 2021-10-26 09:39:49 -06:00
deprecated.rst overflow: Implement size_t saturating arithmetic helpers 2022-02-16 14:29:48 -08:00
development-process.rst
email-clients.rst Documentation/process: expand plain-text advice 2020-09-03 15:39:01 -06:00
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 docs: process/howto.rst: make sections on bug reporting match practice 2021-01-18 12:29:38 -07:00
index.rst Documentation/process: Add Researcher Guidelines 2022-03-09 16:19:23 -07:00
kernel-docs.rst Documentation: Update details of The Linux Kernel Module Programming Guide 2021-08-20 17:05:45 -06:00
kernel-driver-statement.rst
kernel-enforcement-statement.rst Documentation: drop optional BOMs 2021-05-10 15:17:34 -06:00
license-rules.rst LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
magic-number.rst tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
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 Documentation/process/maintainer-pgp-guide: Replace broken link to PGP path finder 2021-08-24 13:23:21 -06:00
maintainer-tip.rst x86/configs: Add x86 debugging Kconfig fragment plus docs 2022-04-06 19:56:29 +02:00
maintainers.rst doc-rst: Programmatically render MAINTAINERS into ReST 2019-10-02 10:03:17 -06:00
management-style.rst Documentation: management-style: Fix formatting of emphsized word 2020-03-10 11:32:34 -06:00
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 doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line 2021-02-22 13:59:10 -07:00
submitting-drivers.rst docs: update file link location 2021-10-12 13:49:27 -06:00
submitting-patches.rst Documentation/process: use scripts/get_maintainer.pl on patches 2022-05-09 16:12:16 -06:00
volatile-considered-harmful.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00