[Orxonox-commit 48] r2753 - trunk/src/util

rgrieder at orxonox.net rgrieder at orxonox.net
Fri Mar 6 19:02:07 CET 2009


Author: rgrieder
Date: 2009-03-06 19:02:07 +0100 (Fri, 06 Mar 2009)
New Revision: 2753

Modified:
   trunk/src/util/SignalHandler.cc
   trunk/src/util/SignalHandler.h
Log:
Signalhandler should not append to orxonox_crash.log but write to the file.
Also removed the XAutoKeyRepeat re-enabling feature because we don't modify XAutoKeyRepeat anymore.

Modified: trunk/src/util/SignalHandler.cc
===================================================================
--- trunk/src/util/SignalHandler.cc	2009-03-06 14:15:18 UTC (rev 2752)
+++ trunk/src/util/SignalHandler.cc	2009-03-06 18:02:07 UTC (rev 2753)
@@ -52,8 +52,6 @@
 
 namespace orxonox
 {
-    bool SignalHandler::bXAutoKeyRepeatOn_ = false;
-
     /**
      * register signal handlers for SIGSEGV and SIGABRT
      * @param appName path to executable eg argv[0]
@@ -64,25 +62,6 @@
       this->appName = appName;
       this->filename = filename;
 
-      // prepare for restoring XAutoKeyRepeat
-      Display* display;
-      if ((display = XOpenDisplay(0)))
-      {
-        XKeyboardState oldState;
-        XGetKeyboardControl(display, &oldState);
-        if (oldState.global_auto_repeat == AutoRepeatModeOn)
-          bXAutoKeyRepeatOn_ = true;
-        else
-          bXAutoKeyRepeatOn_ = false;
-        XCloseDisplay(display);
-      }
-      else
-      {
-        std::cout << "Warning: couldn't open X display to restore XAutoKeyRepeat." << std::endl;
-        bXAutoKeyRepeatOn_ = false;
-      }
-
-
       // make sure doCatch is only called once without calling dontCatch
       assert( sigRecList.size() == 0 );
 
@@ -147,17 +126,6 @@
           break;
       }
 
-      if (bXAutoKeyRepeatOn_)
-      {
-        std::cout << "Trying to restore XAutoKeyRepeat" << std::endl;
-        Display* display;
-        if ((display = XOpenDisplay(0)))
-        {
-          XAutoRepeatOn(display);
-          XCloseDisplay(display);
-        }
-      }
-
       COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox_crash.log" << std::endl;
 
       int sigPipe[2];
@@ -325,7 +293,7 @@
                          "=======================================================\n";
       bt.insert(0, timeString);
 
-      FILE * f = fopen( getInstance().filename.c_str(), "a" );
+      FILE * f = fopen( getInstance().filename.c_str(), "w" );
 
       if ( !f )
       {

Modified: trunk/src/util/SignalHandler.h
===================================================================
--- trunk/src/util/SignalHandler.h	2009-03-06 14:15:18 UTC (rev 2752)
+++ trunk/src/util/SignalHandler.h	2009-03-06 18:02:07 UTC (rev 2753)
@@ -90,9 +90,6 @@
 
         std::string appName;
         std::string filename;
-
-        // used to turn on KeyAutoRepeat if OIS crashes
-        static bool bXAutoKeyRepeatOn_;
     };
 }
 




More information about the Orxonox-commit mailing list