2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-07 08:22:28 +00:00
repo/extra/util-linux/patches/posix.patch

26 lines
617 B
Diff
Raw Normal View History

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