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. --- toys/pending/sh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys') diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 0bfd32c5..8a9e93b6 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -205,13 +205,13 @@ static void run_pipeline(struct pipeline *line) // Is this command a builtin that should run in this process? if (tl && (tl->flags & TOYFLAG_NOFORK)) { struct toy_context temp; - jmp_buf rebound; + sigjmp_buf rebound; // This fakes lots of what toybox_main() does. memcpy(&temp, &toys, sizeof(struct toy_context)); memset(&toys, 0, sizeof(struct toy_context)); - if (!setjmp(rebound)) { + if (!sigsetjmp(rebound, 1)) { toys.rebound = &rebound; toy_init(tl, cmd->argv); tl->toy_main(); -- cgit v1.2.3