=================================================================== RCS file: /home/cvs/OpenXM/src/k097/ox_k0.c,v retrieving revision 1.6 retrieving revision 1.9 diff -u -p -r1.6 -r1.9 --- OpenXM/src/k097/ox_k0.c 2004/09/05 00:51:18 1.6 +++ OpenXM/src/k097/ox_k0.c 2013/11/07 07:29:47 1.9 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/k097/ox_k0.c,v 1.5 2003/12/05 14:02:23 takayama Exp $ */ +/* $OpenXM: OpenXM/src/k097/ox_k0.c,v 1.8 2013/11/06 06:23:23 takayama Exp $ */ #include #include #include @@ -7,6 +7,7 @@ #include #include #include +#include /* -lnsl -lsocket /usr/ucblib/libucb.a */ #include "../kxx/ox_kan.h" #include "../kxx/serversm.h" @@ -69,6 +70,7 @@ nullserver(int fdStreamIn,int fdStreamOut) { ox_stream ostreamIn; ox_stream ostreamOut; char sreason[1024]; + extern int RestrictedMode, RestrictedMode_saved; extern void controlResetHandler(); #if defined(__CYGWIN__) extern sigjmp_buf EnvOfStackMachine; @@ -120,8 +122,9 @@ nullserver(int fdStreamIn,int fdStreamOut) { fprintf(stderr," ?! \n"); fflush(NULL); } if (!Calling_ctrlC_hook) { - Calling_ctrlC_hook = 1; + Calling_ctrlC_hook = 1; RestrictedMode = 0; KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ + RestrictedMode = RestrictedMode_saved; } Calling_ctrlC_hook = 0; KSexecuteString(" (Computation is interrupted.) "); @@ -157,7 +160,12 @@ nullserver(int fdStreamIn,int fdStreamOut) { */ Sm1_pushError2(SerialCurrent,-1,"Global jump by sm1 error"); - KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ + if (!Calling_ctrlC_hook) { + Calling_ctrlC_hook = 1; RestrictedMode = 0; + KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ + RestrictedMode = RestrictedMode_saved; + } + Calling_ctrlC_hook = 0; InSendmsg2=0; signal(SIGUSR1,controlResetHandler); goto aaa ; } else { @@ -335,7 +343,7 @@ nullserver_simplest(int fd) { int c; while(1) { c = readOneByte(fd); - if (c == '@') { return; } + if (c == '@') { return 0; } } }