2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-04 15:02:27 +00:00
repo/extra/util-linux/patches/posix.patch
2024-06-01 19:12:21 -05:00

26 lines
617 B
Diff

diff --git a/tools/all_syscalls b/tools/all_syscalls
index eccb0d0..3d7a34f 100755
--- a/tools/all_syscalls
+++ b/tools/all_syscalls
@@ -1,7 +1,6 @@
-#!/bin/bash
+#!/bin/sh
set -e
-set -o pipefail
SED="$1"
shift
@@ -10,9 +9,9 @@ SYSCALL_INCLUDES="
#include <sys/syscall.h>
"
-trap 'rm -f $OUTPUT $OUTPUT.deps' ERR
+trap '[ $? -eq 0 ] || rm -f $OUTPUT $OUTPUT.deps' EXIT
-"$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \
+echo "$SYSCALL_INCLUDES" | "$@" -MD -MF "$OUTPUT.deps" -dM -E - \
| "$SED" -n -e 's/^#define __NR_\([^ ]*\).*$/UL_SYSCALL("\1", __NR_\1)/p' \
| sort \
> "$OUTPUT"