From bbadc5e14136a4a2011080c08e064108d71e1429 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 22 Jan 2019 12:52:55 -0800 Subject: Fix sigjmp_buf/jmp_buf mismatches. Broke the bionic build: external/toybox/toys/net/netcat.c:188:37: error: incompatible pointer types assigning to 'sigjmp_buf *' (aka 'long (*)[33]') from 'jmp_buf *' (aka 'long (*)[32]') [-Werror,-Wincompatible-pointer-types] if (toys.optflags&FLAG_L) NOEXIT(child = XVFORK()); ^~~~~~~~~~~~~~~~~~~~~~~~ external/toybox/lib/lib.h:375:19: note: expanded from macro 'NOEXIT' #define NOEXIT(x) WOULD_EXIT(_noexit_res, x) ^~~~~~~~~~~~~~~~~~~~~~~~~~ external/toybox/lib/lib.h:367:16: note: expanded from macro 'WOULD_EXIT' toys.rebound = &_noexit; \ ^ ~~~~~~~~ 1 error generated. --- lib/lib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 546b32b3..ed31ffa9 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -360,12 +360,12 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name)); pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid); #define XVFORK() xvforkwrap(vfork()) -// Wrapper to make xfuncs() return (via longjmp) instead of exiting. +// Wrapper to make xfuncs() return (via siglongjmp) instead of exiting. // Assigns true/false "did it exit" value to first argument. -#define WOULD_EXIT(y, x) do { jmp_buf _noexit; \ +#define WOULD_EXIT(y, x) do { sigjmp_buf _noexit; \ int _noexit_res; \ toys.rebound = &_noexit; \ - _noexit_res = setjmp(_noexit); \ + _noexit_res = sigsetjmp(_noexit, 1); \ if (!_noexit_res) do {x;} while(0); \ toys.rebound = 0; \ y = _noexit_res; \ -- cgit v1.2.3