Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions es.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ extern void getsigeffects(Sigeffect effects[]);
extern List *mksiglist(void);
extern void initsignals(Boolean interactive, Boolean allowdumps);
extern Atomic slow;
extern jmp_buf slowlabel;
extern sigjmp_buf slowlabel;
extern Boolean sigint_newline;
extern void sigchk(void);
extern Boolean issilentsignal(List *e);
Expand Down Expand Up @@ -506,7 +506,7 @@ struct Handler {
Root *rootlist;
Push *pushlist;
unsigned long evaldepth;
jmp_buf label;
sigjmp_buf label;
};

extern Handler *tophandler, *roothandler;
Expand All @@ -530,7 +530,7 @@ extern List *raised(List *e);
_localhandler.evaldepth = evaldepth; \
_localhandler.up = tophandler; \
tophandler = &_localhandler; \
if (!setjmp(_localhandler.label)) {
if (!sigsetjmp(_localhandler.label, 0)) {

#define CatchException(e) \
pophandler(&_localhandler); \
Expand Down
2 changes: 1 addition & 1 deletion except.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern Noreturn throw(List *e) {
rootlist = handler->rootlist;
#endif
exception = e;
longjmp(handler->label, 1);
siglongjmp(handler->label, 1);
NOTREACHED;
}

Expand Down
2 changes: 1 addition & 1 deletion input.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static char *callreadline(char *prompt0) {
}
if (RL_ISSTATE(RL_STATE_INITIALIZED))
rl_reset_screen_size();
if (!setjmp(slowlabel)) {
if (!sigsetjmp(slowlabel, 1)) {
slow = TRUE;
r = readline(prompt);
} else {
Expand Down
2 changes: 1 addition & 1 deletion signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void catcher(int sig) {
++sigcount;
}
if (slow)
longjmp(slowlabel, 1);
siglongjmp(slowlabel, 1);
}


Expand Down
14 changes: 4 additions & 10 deletions stdenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,10 @@ extern void *qsort(

/* setjmp */

#if defined sigsetjmp || HAVE_SIGSETJMP
/* under linux, sigsetjmp and setjmp are both macros
* -- need to undef setjmp to avoid problems
*/
# ifdef setjmp
# undef setjmp
# endif
# define setjmp(buf) sigsetjmp(buf,1)
# define longjmp(x,y) siglongjmp(x,y)
# define jmp_buf sigjmp_buf
#if !defined sigsetjmp && !HAVE_SIGSETJMP
#define sigsetjmp(b,n) setjmp(b)
#define siglongjmp(x,y) longjmp(x,y)
#define sigjmp_buf jmp_buf
#endif


Expand Down