=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_launch.c,v retrieving revision 1.12 retrieving revision 1.14 diff -u -p -r1.12 -r1.14 --- OpenXM_contrib2/asir2000/io/ox_launch.c 2001/06/06 02:21:40 1.12 +++ OpenXM_contrib2/asir2000/io/ox_launch.c 2001/07/23 05:05:41 1.14 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/ox_launch.c,v 1.11 2000/12/16 07:12:01 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox_launch.c,v 1.13 2001/06/27 09:14:08 noro Exp $ */ #include #include @@ -82,6 +82,7 @@ static int ox_io_init(int); static void push_one(Obj); static Obj pop_one(); static void do_cmd(int); +static void terminate_server(); static Obj *asir_OperandStack; static int asir_OperandStackPtr; @@ -184,6 +185,9 @@ char **argv; #if defined(SIGUSR1) signal(SIGUSR1,SIG_IGN); #endif +#if defined(SIGTERM) + signal(SIGTERM,terminate_server); +#endif if ( accept_client ) { cs = try_bind_listen(use_unix,control_port_str); @@ -408,5 +412,13 @@ static Obj pop_one() { if ( asir_OperandStackPtr >= 0 ) { return asir_OperandStack[asir_OperandStackPtr--]; } +} + +static void terminate_server() +{ +#if defined(SIGKILL) + kill(cpid,SIGKILL); +#endif + exit(0); }