[LON-CAPA-cvs] cvs: loncom / lonmaxima
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 12 Jun 2007 23:48:45 -0000
albertel Tue Jun 12 19:48:45 2007 EDT
Modified files:
/loncom lonmaxima
Log:
- in some cases maxima just goes off and spins and spins, soft_close
never returns etc. so taking the forceful way at when exiting
Index: loncom/lonmaxima
diff -u loncom/lonmaxima:1.29 loncom/lonmaxima:1.30
--- loncom/lonmaxima:1.29 Sat May 26 12:00:30 2007
+++ loncom/lonmaxima Tue Jun 12 19:48:45 2007
@@ -3,7 +3,7 @@
# The LearningOnline Network with CAPA
# Connect to MAXIMA CAS
#
-# $Id: lonmaxima,v 1.29 2007/05/26 16:00:30 www Exp $
+# $Id: lonmaxima,v 1.30 2007/06/12 23:48:45 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -237,7 +237,7 @@
return;
} else {
# Child can *not* return from this subroutine.
- $SIG{INT} = 'DEFAULT'; # make SIGINT kill us as it did before
+
# unblock signals
sigprocmask(SIG_UNBLOCK, $sigset)
@@ -246,7 +246,15 @@
&logthis('New process started');
my $command=Expect->spawn('maxima');
- $command->log_stdout(0);
+ # soft/hard_close can take awhile and we really
+ # don't care we just want it gone
+ $SIG{INT} = sub {
+ my $pid = $command->pid();
+ kill('KILL'=>$pid);
+ exit;
+ };
+
+ $command->log_stdout(0);
#$command->log_file("$execdir/logs/lonmaxima.session.log");
&getmaximaoutput($command);