From: Nicolas Schier <nicolas.schier@linux.dev>
Ensure cleanup of test_fortify.sh's temporary file also on script
interruption, or some common signals.
Reported-by: WangYuli <wangyuli@aosc.io>
Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/
Signed-off-by: Nicolas Schier <n.schier@avm.de>
---
lib/test_fortify/test_fortify.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_fortify/test_fortify.sh b/lib/test_fortify/test_fortify.sh
index 368d07d9acbf..ad6dd44fa31c 100644
--- a/lib/test_fortify/test_fortify.sh
+++ b/lib/test_fortify/test_fortify.sh
@@ -29,7 +29,7 @@ shift
__cleanup() {
rm -f "$TMP"
}
-trap __cleanup EXIT
+trap __cleanup EXIT HUP INT QUIT TERM
# Function names in warnings are wrapped in backticks under UTF-8 locales.
# Run the commands with LANG=C so that grep output will not change.
--
2.51.0
On Fri, Nov 28, 2025 at 08:27:58PM +0100, Nicolas Schier wrote:
> From: Nicolas Schier <nicolas.schier@linux.dev>
>
> Ensure cleanup of test_fortify.sh's temporary file also on script
> interruption, or some common signals.
>
> Reported-by: WangYuli <wangyuli@aosc.io>
> Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/
> Signed-off-by: Nicolas Schier <n.schier@avm.de>
I guess with patch 1, this does not become as big of a deal. Kees, is
there any reason to leave these temporary files around if there was an
interruption or other signal? I do not see any obvious ones so:
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> lib/test_fortify/test_fortify.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/test_fortify/test_fortify.sh b/lib/test_fortify/test_fortify.sh
> index 368d07d9acbf..ad6dd44fa31c 100644
> --- a/lib/test_fortify/test_fortify.sh
> +++ b/lib/test_fortify/test_fortify.sh
> @@ -29,7 +29,7 @@ shift
> __cleanup() {
> rm -f "$TMP"
> }
> -trap __cleanup EXIT
> +trap __cleanup EXIT HUP INT QUIT TERM
>
> # Function names in warnings are wrapped in backticks under UTF-8 locales.
> # Run the commands with LANG=C so that grep output will not change.
>
> --
> 2.51.0
>
On 2025/11/29 03:27, Nicolas Schier wrote:
> From: Nicolas Schier <nicolas.schier@linux.dev>
>
> Ensure cleanup of test_fortify.sh's temporary file also on script
> interruption, or some common signals.
>
> Reported-by: WangYuli <wangyuli@aosc.io>
> Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/
> Signed-off-by: Nicolas Schier <n.schier@avm.de>
> ---
> lib/test_fortify/test_fortify.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/test_fortify/test_fortify.sh b/lib/test_fortify/test_fortify.sh
> index 368d07d9acbf..ad6dd44fa31c 100644
> --- a/lib/test_fortify/test_fortify.sh
> +++ b/lib/test_fortify/test_fortify.sh
> @@ -29,7 +29,7 @@ shift
> __cleanup() {
> rm -f "$TMP"
> }
> -trap __cleanup EXIT
> +trap __cleanup EXIT HUP INT QUIT TERM
>
> # Function names in warnings are wrapped in backticks under UTF-8 locales.
> # Run the commands with LANG=C so that grep output will not change.
>
Reviewed-by: WangYuli <wangyuli@aosc.io>
Thans,
--
WangYuli
© 2016 - 2026 Red Hat, Inc.