about summary refs log tree commit diff
path: root/setjmp
diff options
context:
space:
mode:
Diffstat (limited to 'setjmp')
-rw-r--r--setjmp/Makefile2
-rw-r--r--setjmp/longjmp.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/setjmp/Makefile b/setjmp/Makefile
index 4a7e4aa85a..4773b617e1 100644
--- a/setjmp/Makefile
+++ b/setjmp/Makefile
@@ -24,7 +24,7 @@ subdir	:= setjmp
 headers	:= setjmp.h jmp_buf.h
 
 routines	:= setjmp sigjmp bsd-setjmp bsd-_setjmp \
-		   longjmp __longjmp
+		   longjmp __longjmp jmp-unwind
 
 tests		:= tst-setjmp
 
diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c
index d4e4ef7740..c70be7b886 100644
--- a/setjmp/longjmp.c
+++ b/setjmp/longjmp.c
@@ -21,12 +21,17 @@ Cambridge, MA 02139, USA.  */
 #include <signal.h>
 
 
+extern void _longjmp_unwind (jmp_buf env, int val);
+
 /* Set the signal mask to the one specified in ENV, and jump
    to the position specified in ENV, causing the setjmp
    call there to return VAL, or 1 if VAL is 0.  */
 void
 longjmp (sigjmp_buf env, int val)
 {
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
   if (env[0].__mask_was_saved)
     /* Restore the saved signal mask.  */
     (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,