made usage of libi2ncommon signal funcs optional
authorReinhard Pfau <Reinhard.Pfau@gmx.de>
Tue, 24 Mar 2009 21:06:16 +0000 (22:06 +0100)
committerReinhard Pfau <Reinhard.Pfau@gmx.de>
Tue, 24 Mar 2009 21:06:16 +0000 (22:06 +0100)
asyncio/async_io.cpp

index 95d916b..a69494f 100644 (file)
@@ -9,6 +9,7 @@
 //#define NOISEDEBUG
 
 #include "async_io.hpp"
+#include <asyncio_config.hpp>
 
 #include <list>
 #include <vector>
 
 #include <boost/bind.hpp>
 
-#include <signalfunc.hpp>
-#include <timefunc.hxx>
+#ifdef HAVE_LIBI2NCOMMON
+#  include <signalfunc.hpp>
+//#  include <timefunc.hxx>
+#else
+#include <signal.h>
+#endif
 
 #include <iostream>
 
@@ -1111,13 +1116,21 @@ Backend::Backend()
 : m_count_active_loops(0)
 , m_count_stop_requests(0)
 {
+#ifdef HAVE_LIBI2NCOMMON
     SystemTools::ignore_signal( SystemTools::Signal::PIPE );
+#else
+    signal( SIGPIPE, SIG_IGN );
+#endif
 } // eo Backend::Backend
 
 
 Backend::~Backend()
 {
+#ifdef HAVE_LIBI2NCOMMON
     SystemTools::restore_signal_handler( SystemTools::Signal::PIPE );
+#else
+    signal( SIGPIPE, SIG_DFL );
+#endif
 } // eo Backend::~Backend()
 
 /**