Great, I haven't had an opportunity to run the new version yet. I took time to compile though, and there is a problem compiling terrasync.cxx on mac because of Apples typedef of the signal handler. I attached a small fix.

Jari



On 2/28/10 5:51 PM, Alex Perry wrote:
Attached patch replaces the stream with a single direct call to
write() inside the signal handler; someone Windows based might want to
give it a look before committing.  I also removed references to std::
which are they're superfluous after "using namespace" directive at the
top.

On Sun, Feb 28, 2010 at 8:16 AM, Alex Perry<alex.pe...@ieee.org>  wrote:
On Sun, Feb 28, 2010 at 3:59 AM, Tim Moore<timoor...@gmail.com>  wrote:
Whoops, I'm a bit late with my comments, but all the same...

You can't safely use C++ stream functions in a signal handler.

Drat, true.  A simple write() would be fine, given what I'm using it for.

Why does terrasync need to be protected from interruption like this? Does
the SVN update really get corrupted if it is interrupted?

Yep.  If we think the individual update could take a long time, we
could go to the extra effort and use the svn internal interruption
handlers.



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Index: terrasync.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/utils/TerraSync/terrasync.cxx,v
retrieving revision 1.30
@@ -276,6 +276,9 @@ void sync_tree(const char* dir) {
 #ifdef _MSC_VER
 typedef void (__cdecl * sighandler_t)(int);
 #endif
+#if defined( __APPLE__ )
+typedef sig_t sighandler_t;
+#endif
 
 bool terminating = false;
 sighandler_t prior_signal_handlers[32];
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to