[Tux4kids-commits] r1605 - tuxmath/trunk/src
David Bruce
dbruce-guest at alioth.debian.org
Sat Oct 24 14:40:09 UTC 2009
Author: dbruce-guest
Date: 2009-10-24 14:40:08 +0000 (Sat, 24 Oct 2009)
New Revision: 1605
Modified:
tuxmath/trunk/src/menu.c
tuxmath/trunk/src/server.c
tuxmath/trunk/src/tuxmath.c
Log:
beginning work on avoiding crash if player tries to create second server
Modified: tuxmath/trunk/src/menu.c
===================================================================
--- tuxmath/trunk/src/menu.c 2009-10-24 14:39:33 UTC (rev 1604)
+++ tuxmath/trunk/src/menu.c 2009-10-24 14:40:08 UTC (rev 1605)
@@ -595,7 +595,7 @@
#ifdef HAVE_PTHREAD_H
- ShowMessage(_("Select lesson file for server to use"), NULL, NULL, NULL);
+ ShowMessage(_("Click or press key to select server lesson file"), NULL, NULL, NULL);
{
chosen_lesson = run_menu(menus[MENU_LESSONS], true);
Modified: tuxmath/trunk/src/server.c
===================================================================
--- tuxmath/trunk/src/server.c 2009-10-24 14:39:33 UTC (rev 1604)
+++ tuxmath/trunk/src/server.c 2009-10-24 14:40:08 UTC (rev 1605)
@@ -115,6 +115,10 @@
/* allow the server to be run as a function in a process or thread */
/* within another program. main() is now in a separate file, */
/* servermain.c, that consists solely of a call to RunServer(). */
+
+/* FIXME this isn't thread-safe - we need to return gracefully if we */
+/* find that the server is already running, instead of calling cleanup() */
+/* and crashing the program. */
int RunServer(int argc, char* argv[])
{
Uint32 timer = 0;
@@ -158,7 +162,9 @@
return EXIT_SUCCESS;
}
-
+/* If we can't use pthreads, we use this function */
+/* to launch the server as a separate program using */
+/* the C library system() call */
int RunServer_prog(int argc, char* argv[])
{
char buf[256];
Modified: tuxmath/trunk/src/tuxmath.c
===================================================================
--- tuxmath/trunk/src/tuxmath.c 2009-10-24 14:39:33 UTC (rev 1604)
+++ tuxmath/trunk/src/tuxmath.c 2009-10-24 14:40:08 UTC (rev 1605)
@@ -23,6 +23,7 @@
#include "tuxmath.h"
#include "setup.h"
#include "titlescreen.h"
+#include "linewrap.h"
#include <stdio.h>
#include <stdlib.h>
@@ -33,16 +34,10 @@
#define TUXLOCALE LOCALEDIR
#endif
-//#ifdef LINEBREAK
-#include "linewrap.h"
-//#endif
-
-int main(int argc, char * argv[])
+int main(int argc, char* argv[])
{
const char *s1, *s2, *s3, *s4;
-#ifdef ENABLE_NLS
-printf("ENABLE_NLS defined\n");
-#endif
+
s1 = setlocale(LC_ALL, "");
s2 = bindtextdomain(PACKAGE, TUXLOCALE);
s3 = bind_textdomain_codeset(PACKAGE, "UTF-8");
More information about the Tux4kids-commits
mailing list