unconditionally use namespace I2n; include signalfunc from our utils
authorReinhard Pfau <Reinhard.Pfau@gmx.de>
Sun, 12 Apr 2009 22:22:51 +0000 (00:22 +0200)
committerReinhard Pfau <Reinhard.Pfau@gmx.de>
Sun, 12 Apr 2009 22:22:51 +0000 (00:22 +0200)
asyncio/async_io.cpp
asyncio/async_io.hpp

index 564f4e0..c85edb5 100644 (file)
@@ -41,12 +41,7 @@ on this file might be covered by the GNU General Public License.
 
 #include <boost/bind.hpp>
 
-#ifdef HAVE_LIBI2NCOMMON
-#  include <signalfunc.hpp>
-//#  include <timefunc.hxx>
-#else
-#include <signal.h>
-#endif
+#include <asyncio_signalfunc.hpp>
 
 #include <iostream>
 
@@ -97,7 +92,7 @@ struct PollFd : public ::pollfd
 
     /**
      * initializes the struct with a given file descriptor and clears the event mask(s).
-     * @param _fd 
+     * @param _fd
      */
     PollFd(int _fd)
     {
@@ -580,7 +575,7 @@ void IOImplementation::close(Direction direction)
             case Direction::in:
                 {
                     int res= ::shutdown(m_read_fd, SHUT_RD);
-                    if (res<0) 
+                    if (res<0)
                     {
                         m_errno= errno;
                     }
@@ -697,7 +692,7 @@ bool IOImplementation::writable() const
 
 /**
  * returns if the output buffer is empty.
- * @return 
+ * @return
  */
 bool IOImplementation::empty() const
 {
@@ -1131,21 +1126,13 @@ 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
+       SystemTools::ignore_signal( SystemTools::Signal::PIPE );
 } // eo Backend::Backend
 
 
 Backend::~Backend()
 {
-#ifdef HAVE_LIBI2NCOMMON
     SystemTools::restore_signal_handler( SystemTools::Signal::PIPE );
-#else
-    signal( SIGPIPE, SIG_DFL );
-#endif
 } // eo Backend::~Backend()
 
 /**
@@ -1180,7 +1167,7 @@ Backend* Backend::getBackend()
  *
  * @note this method is a little beast.
  *
- * @internal 
+ * @internal
  * The cycle is divided into four steps: collecting; poll; mark and execute.
  * The "mark" step is necessary to avoid some bad side effects when method calls in the execution stage
  * are calling @a Backup::doOneStep or open their own local backend loop.
@@ -1257,7 +1244,7 @@ bool Backend::doOneStep(int timeout)
             // TODO
 
             for(internal_io::TimerList::iterator it_timer= internal_io::g_timer_list().begin();
-                it_timer != internal_io::g_timer_list().end() 
+                it_timer != internal_io::g_timer_list().end()
                 && (!had_active_object || !min_event_time_set || current_time < min_event_time);
                 ++ it_timer)
             {
@@ -1473,7 +1460,7 @@ void Backend::run()
             // and forward the exception
             throw;
         }
-    } 
+    }
     while (0 == m_count_stop_requests);
     --m_count_active_loops;
     --m_count_stop_requests;
index 989b282..1737323 100644 (file)
@@ -46,9 +46,8 @@ on this file might be covered by the GNU General Public License.
 namespace AsyncIo
 {
 
-#ifdef HAVE_LIBI2NCOMMON
 using namespace I2n;
-#endif
+
 using Utils::MilliTime;
 
 /*
@@ -95,7 +94,7 @@ class TimerBase
         TimerBase();
         virtual ~TimerBase();
 
-        bool active() const { return m_active; } 
+        bool active() const { return m_active; }
 
         MilliTime getWhenTime() const {return m_when;}
         MilliTime getRealWhenTime() const;