Vanilla Development Maling List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/robots



Date:	Wednesday June 2, 1999 @ 23:57
Author:	jeffno

Update of /home/netrek/cvsroot/Vanilla/robots
In directory cvs.castle.real-time.com:/var/tmp/cvs-serv4492/Vanilla/robots

Modified Files:
	inl.c 
Log Message:
Ignore SIGALRM inside of a move, and re-install
it at the end of a move.  This prevents a move (or tick)
of the server from being interrupted by the signal for
the next move if it hasn't finished yet.

****************************************

Index: Vanilla/robots/inl.c
diff -u Vanilla/robots/inl.c:1.16 Vanilla/robots/inl.c:1.17
--- Vanilla/robots/inl.c:1.16	Fri Apr 30 18:31:36 1999
+++ Vanilla/robots/inl.c	Wed Jun  2 23:57:05 1999
@@ -1,7 +1,7 @@
-/* 	$Id: inl.c,v 1.16 1999/04/30 23:31:36 ahn Exp $	 */
+/* 	$Id: inl.c,v 1.17 1999/06/03 04:57:05 jeffno Exp $	 */
 
 #ifndef lint
-static char vcid[] = "$Id: inl.c,v 1.16 1999/04/30 23:31:36 ahn Exp $";
+static char vcid[] = "$Id: inl.c,v 1.17 1999/06/03 04:57:05 jeffno Exp $";
 #endif /* lint */
 
 /*
@@ -215,7 +215,8 @@
 
   /***** Start The Code Here *****/
 
-  HANDLE_SIG(SIGALRM,inlmove);
+  /* Don't tell us it's time for another move in the middle of a move. */
+  SIGNAL(SIGALRM, SIG_IGN);
 
 #ifdef INLDEBUG
   ERROR(2,("Enter inlsmove\n"));
@@ -233,8 +234,10 @@
     inl_confine();
 
   if (!(inl_stat.flags & (S_TOURNEY | S_OVERTIME)) ||
-      (inl_stat.flags & S_FREEZE ))
+      (inl_stat.flags & S_FREEZE )) {
+    SIGNAL(SIGALRM, inlmove);
     return;
+  }
 
   inl_stat.game_ticks++;
 
@@ -275,6 +278,8 @@
 #ifdef INLDEBUG
   ERROR(2,("	game ticks = %d\n", inl_stat.game_ticks));
 #endif
+
+  SIGNAL(SIGALRM, inlmove);
 }
 
 player_maint()