From d53a1529bd79077a8e7232651f99f20890283c0c Mon Sep 17 00:00:00 2001 From: sewn Date: Tue, 8 Aug 2023 11:50:10 +0300 Subject: [PATCH] tools/all_syscalls: use pipefail --- tools/all_syscalls | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/all_syscalls b/tools/all_syscalls index aa068a3f20..e4327b2d99 100755 --- a/tools/all_syscalls +++ b/tools/all_syscalls @@ -1,17 +1,17 @@ #!/bin/sh -set -e - OUTPUT=syscalls.h SYSCALL_INCLUDES=" #include " -trap 'rm $OUTPUT $OUTPUT.deps' ERR +# pipefail is part of modern POSIX +# shellcheck disable=SC3040 +set -o pipefail echo "$SYSCALL_INCLUDES" \ | "$@" -MD -MF "$OUTPUT.deps" -dM -E - \ | grep '^#define __NR_' \ | sed 's/#define __NR_\([^[:space:]]*\).*/UL_SYSCALL("\1", __NR_\1)/' \ | sort \ - > "$OUTPUT" + > "$OUTPUT" || { rm $OUTPUT $OUTPUT.deps; return 1; } -- 2.47.2