opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

0002-Make-tcp_sysent-a-static-inline-function.patch (1042B)


      1 From 75a23af067ff5390a47df1e877f68834241009b9 Mon Sep 17 00:00:00 2001
      2 From: Michael Forney <mforney@mforney.org>
      3 Date: Sat, 6 Jul 2019 01:40:36 -0700
      4 Subject: [PATCH] Make tcp_sysent a static inline function
      5 
      6 This way we can include the second operand to the conditional
      7 operator without evaluating the macro argument multiple times.
      8 ---
      9  src/defs.h | 8 ++++++--
     10  1 file changed, 6 insertions(+), 2 deletions(-)
     11 
     12 diff --git a/src/defs.h b/src/defs.h
     13 index ae1d1d1dc..bbd8f6748 100644
     14 --- a/src/defs.h
     15 +++ b/src/defs.h
     16 @@ -402,8 +402,12 @@ struct tcb {
     17  # define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
     18  # define has_seccomp_filter(tcp)	((tcp)->flags & TCB_SECCOMP_FILTER)
     19  
     20 -extern const struct_sysent stub_sysent;
     21 -# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent)
     22 +static inline const struct_sysent *
     23 +tcp_sysent(struct tcb *tcp)
     24 +{
     25 +	extern const struct_sysent stub_sysent;
     26 +	return tcp->s_ent ? tcp->s_ent : &stub_sysent;
     27 +}
     28  # define n_args(tcp) (tcp_sysent(tcp)->nargs)
     29  
     30  # include "xlat.h"
     31 -- 
     32 2.44.0
     33