rnd-20140827-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 27 Aug 2014 21:56:46 +0000 (23:56 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 09:01:39 +0000 (11:01 +0200)
* error file set to unbuffered to prevent truncation in case of crashes

ChangeLog
src/Makefile
src/conftime.h
src/libgame/misc.c
src/libgame/sdl.c

index cec3597aaf0e423336f16e7a677e670c2f15eeca..b58b9423da9af3a28f2aa47196785977e1c0d4c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2014-08-27
+       * error file set to unbuffered to prevent truncation in case of crashes
+
 2014-08-19
        * fixed bug causing wrong screen updates while playing (whole screen
          update from backbuffer instead of playfield buffer if REDRAW_ALL set)
index 2a02d8165882463f8f45634d78e6bb4a7b29faee..265bf9922e68382b2b2337a30a94c347160a0bf8 100644 (file)
@@ -259,7 +259,8 @@ conf_snd.h: conf_snd.c
 conf_mus.h: conf_mus.c
        @$(MAKE) auto-conf
 
-$(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) $(GAME_SP)
+# $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) $(GAME_SP)
+$(TIMESTAMP_FILE): $(SRCS) $(RNDLIBS)
        @date '+"%Y-%m-%d %H:%M"' \
        | sed -e 's/^/#define COMPILE_DATE_STRING /' \
        > $(TIMESTAMP_FILE)
@@ -277,9 +278,10 @@ clean-obj:
        $(MAKE) -C $(GAME_EM_DIR) clean
        $(MAKE) -C $(GAME_SP_DIR) clean
        $(RM) $(OBJS)
-       $(RM) $(LIBGAME)
-       $(RM) $(GAME_EM)
-       $(RM) $(GAME_SP)
+       $(RM) $(RNDLIBS)
+#      $(RM) $(LIBGAME)
+#      $(RM) $(GAME_EM)
+#      $(RM) $(GAME_SP)
 
 clean-ico:
        $(RM) $(ICONBASE).ico
index 590154cff7319f1b84aab068cd55677edad810eb..9a502daa15c8e0715dc05dcbadc9e1e0af53eb3d 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-08-19 21:46"
+#define COMPILE_DATE_STRING "2014-08-27 13:39"
index 5fdbe85b42b800d323ace39fd28c5ef1b28d3bcf..39a55435f9720611e17fa1b04218f7e4bee349ab 100644 (file)
@@ -3691,6 +3691,9 @@ void openErrorFile()
     Error(ERR_WARN, "cannot open file '%s' for writing: %s",
          program.error_filename, strerror(errno));
   }
+
+  /* error output should be unbuffered so it is not truncated in a crash */
+  setbuf(program.error_file, NULL);
 }
 
 void closeErrorFile()
index 0b27fafbfec3ad71b4840a2b885d3c96282cc297..b6fd5b407b2ec9dbfcfe9f0d0af3e49c9d1ddaa7 100644 (file)
@@ -515,8 +515,17 @@ static SDL_Surface *SDLCreateScreen(DrawBuffer **backbuffer,
 
   if (sdl_window != NULL)
   {
+#if 0
+    /* if SDL_CreateRenderer() is called from within a VirtualBox Windows VM
+     *without* enabling 2D/3D acceleration and/or guest additions installed,
+     it will crash if flags are *not* set to SDL_RENDERER_SOFTWARE (because
+     it will try to use accelerated graphics and apparently fails miserably) */
+    if (sdl_renderer == NULL)
+      sdl_renderer = SDL_CreateRenderer(sdl_window, -1, SDL_RENDERER_SOFTWARE);
+#else
     if (sdl_renderer == NULL)
       sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
+#endif
 
     if (sdl_renderer != NULL)
     {