]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools/all_syscalls: use pipefail
authorsewn <sewn@disroot.org>
Tue, 8 Aug 2023 08:50:10 +0000 (11:50 +0300)
committersewn <sewn@disroot.org>
Tue, 8 Aug 2023 08:50:10 +0000 (11:50 +0300)
tools/all_syscalls

index aa068a3f20db4d5077a3ef76a48e17edac6762d2..e4327b2d99522dd4f9fbba7c3d137f6c3eafc81d 100755 (executable)
@@ -1,17 +1,17 @@
 #!/bin/sh
 
-set -e
-
 OUTPUT=syscalls.h
 SYSCALL_INCLUDES="
 #include <sys/syscall.h>
 "
 
-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; }