=================================================================== RCS file: /home/cvs/OpenXM/src/k097/ki.c,v retrieving revision 1.7 retrieving revision 1.10 diff -u -p -r1.7 -r1.10 --- OpenXM/src/k097/ki.c 2005/06/16 05:07:24 1.7 +++ OpenXM/src/k097/ki.c 2016/03/31 05:27:34 1.10 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/k097/ki.c,v 1.6 2003/12/05 14:02:23 takayama Exp $ */ +/* $OpenXM: OpenXM/src/k097/ki.c,v 1.9 2015/10/10 11:29:46 takayama Exp $ */ /* ki.c ( kx interpreter ) */ #include @@ -11,6 +11,9 @@ #include "gradedset.h" #include #include +#include +#include +#include "mysig.h" char *getLOAD_K_PATH(); /* from d.h */ @@ -45,28 +48,28 @@ sendKan(int p) { struct object obj = OINIT; int result; extern int InSendmsg2; - signal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */ - if (p == 10) {printf("In(%d)= ",n++); return;} + mysignal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */ + if (p == 10) {printf("In(%d)= ",n++); return 0;} if (p == 0 && DebugCompiler) printf("sendKan[%s]\n",Kbuff); /* printf("sendKan[%s]\n",Kbuff); */ if (strlen(Kbuff) != 0) { - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); result = KSexecuteString(Kbuff); /* fprintf(stderr,"r=%d ",result); */ - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ } /* fprintf(stderr,"r=%d ",result); */ if (result == -1) { K00recoverFromError(); InSendmsg2 = 0; fprintf(stderr,"--- Engine error or interrupt : "); if (DebugMode) { - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); KSexecuteString("db.DebugStack setstack "); - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ obj = KSpop(); - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); KSexecuteString("stdstack "); - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ if (obj.tag == Sdollar) { fprintf(stderr,"%s\n",obj.lc.str); fprintf(stderr,"\n"); @@ -157,7 +160,7 @@ execFile(char *s) fprintf(stderr,"Fatal error: Cannot open the system macro %s in %s, %s, %s nor %s.\n", s,tname2,tname3,tname4,tname); exit(11); - return; + return 0; } } }