aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.h6
1 files changed, 3 insertions, 3 deletions
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; \