refactored handleSignal
[physics.git] / src / handleSignal.cpp
index ef9daa6..cd1fcec 100644 (file)
 
 #include <iostream>
 #include <signal.h>
+#include <stdlib.h>
 
 /// ***** Private Method Headers *****
 
-void sighandler( int sig );
+static void sighandler( int iSig );
 
 /// ***** Public Methods *****
 
@@ -45,10 +46,10 @@ void installSignal()
 /// ***** Private Methods *****
 
 // signal handler function
-void sighandler( int sig )
+void sighandler( int iSig )
 {
 #ifndef __WIN32__
-    switch(sig)
+    switch(iSig)
     {
         case SIGINT:
             std::cerr << "SIGINT caught" << std::endl;
@@ -58,6 +59,6 @@ void sighandler( int sig )
     }
 
     // normally an abort is better ... but this is just SIGINT
-    exit(sig);
+    exit(iSig);
 #endif // __WIN32__
 }