More interrupt handling cleanups!

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@104 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2001-06-27 13:22:30 +00:00
parent 362bf807a4
commit efd998524f
7 changed files with 89 additions and 46 deletions

View File

@@ -1196,26 +1196,23 @@ ConsoleGetc(int sno)
strncpy (Prompt, RepAtom (*AtPrompt)->StrOfAE, MAX_PROMPT);
newline = FALSE;
}
in_getc = TRUE;
#if HAVE_SIGINTERRUPT
siginterrupt(SIGINT, TRUE);
#endif
in_getc = TRUE;
ch = YP_fgetc(s->u.file.file);
in_getc = FALSE;
#if HAVE_SIGINTERRUPT
siginterrupt(SIGINT, FALSE);
#endif
in_getc = FALSE;
if (PrologMode & AbortMode) {
PrologMode &= ~AbortMode;
CreepFlag = CalculateStackGap();
if (ProcessSIGINT() < 0) Abort("");
newline = TRUE;
goto restart;
} else if (ch == -1 && errno == EINTR) {
errno = 0;
PrologMode &= ~AbortMode;
if (ProcessSIGINT() < 0) Abort("");
if (PrologMode & InterruptMode) {
PrologMode &= ~InterruptMode;
ProcessSIGINT();
newline = TRUE;
if (PrologMode & AbortMode) {
PrologMode &= ~AbortMode;
Abort("");
}
goto restart;
}
return(console_post_process_read_char(ch, s, sno));