From 74786da63687ff5fac07ab239a7d5297eb2ca53f Mon Sep 17 00:00:00 2001 From: Reinhard Pfau Date: Mon, 13 Apr 2009 00:22:51 +0200 Subject: [PATCH] unconditionally use namespace I2n; include signalfunc from our utils --- asyncio/async_io.cpp | 29 ++++++++--------------------- asyncio/async_io.hpp | 5 ++--- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/asyncio/async_io.cpp b/asyncio/async_io.cpp index 564f4e0..c85edb5 100644 --- a/asyncio/async_io.cpp +++ b/asyncio/async_io.cpp @@ -41,12 +41,7 @@ on this file might be covered by the GNU General Public License. #include -#ifdef HAVE_LIBI2NCOMMON -# include -//# include -#else -#include -#endif +#include #include @@ -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; diff --git a/asyncio/async_io.hpp b/asyncio/async_io.hpp index 989b282..1737323 100644 --- a/asyncio/async_io.hpp +++ b/asyncio/async_io.hpp @@ -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; -- 1.7.1