diff options
| author | Michael Forney <mforney@mforney.org> | 2024-03-21 23:29:18 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2024-03-21 23:29:18 -0700 |
| commit | 594971b59caa1d75f0179de8d612375f410a7566 (patch) | |
| tree | dd14cb80cc3c90a9019b0d9442a2dd8d6a02d9df /pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch | |
| parent | 01eb93d6f752c2bb3815bb794572231651f105fa (diff) | |
Remove obsolete portability patches with C23 and new cproc
Diffstat (limited to 'pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch')
| -rw-r--r-- | pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch b/pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch new file mode 100644 index 00000000..2fcba055 --- /dev/null +++ b/pkg/strace/patch/0002-Make-tcp_sysent-a-static-inline-function.patch @@ -0,0 +1,33 @@ +From 75a23af067ff5390a47df1e877f68834241009b9 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 6 Jul 2019 01:40:36 -0700 +Subject: [PATCH] Make tcp_sysent a static inline function + +This way we can include the second operand to the conditional +operator without evaluating the macro argument multiple times. +--- + src/defs.h | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/defs.h b/src/defs.h +index ae1d1d1dc..bbd8f6748 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -402,8 +402,12 @@ struct tcb { + # define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL) + # define has_seccomp_filter(tcp) ((tcp)->flags & TCB_SECCOMP_FILTER) + +-extern const struct_sysent stub_sysent; +-# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent) ++static inline const struct_sysent * ++tcp_sysent(struct tcb *tcp) ++{ ++ extern const struct_sysent stub_sysent; ++ return tcp->s_ent ? tcp->s_ent : &stub_sysent; ++} + # define n_args(tcp) (tcp_sysent(tcp)->nargs) + + # include "xlat.h" +-- +2.44.0 + |
