make rl not deadlock under SIGINT

This commit is contained in:
Vítor Santos Costa
2011-03-01 12:31:19 +00:00
parent 73541f506f
commit b868d85ac8
9 changed files with 22 additions and 20 deletions

View File

@@ -482,8 +482,9 @@ Sread_readline(void *handle, char *buf, size_t size)
rl_prep_terminal(FALSE);
rl_readline_state = state;
rl_done = 0;
} else
} else {
line = pl_readline(prompt);
}
in_readline--;
if ( my_prompt )
@@ -513,6 +514,12 @@ Sread_readline(void *handle, char *buf, size_t size)
PL_clock_wait_ticks(clock() - oldclock);
#endif
#if __YAP_PROLOG__
/* handle abort */
if (Yap_REGS.P_ == FAILCODE) {
return 0;
}
#endif
return rval;
}