// $Id$
//
-// Copyright (C) 2009
+// Copyright (C) 2009
// Fraunhofer Institute for Open Communication Systems (FOKUS)
// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
// Custom includes
#include "IdleEvent.hh"
-#ifdef HAVE_TIMERFD
-#include <sys/timerfd.h>
+#ifdef HAVE_TIMERFD_CREATE
+#include TIMERFD_H_PATH
#endif
+#include "senf/Utils/IgnoreValue.hh"
//#include "TimerSource.mpp"
#define prefix_
SENF_THROW_SYSTEM_EXCEPTION("pipe()");
senf::scheduler::detail::FdManager::instance().set(
timerPipe_[0], detail::FdManager::EV_READ, this);
-
+
sigemptyset(&sigSet_);
sigaddset(&sigSet_, SIGALRM);
sigprocmask(SIG_BLOCK, &sigSet_, 0);
if (siginfo->si_value.sival_ptr == 0)
return;
static char data = '\xD0';
- write(static_cast<POSIXTimerSource*>(siginfo->si_value.sival_ptr)->timerPipe_[1],
- &data, sizeof(data));
+ // If the write fails there's not much we can do anyways ...
+ senf::IGNORE( write(static_cast<POSIXTimerSource*>(siginfo->si_value.sival_ptr)->timerPipe_[1],
+ &data, sizeof(data)) );
}
prefix_ void senf::scheduler::detail::POSIXTimerSource::signal(int events)
{
char data;
- read(timerPipe_[0], &data, sizeof(data));
+ // This should never fail since we are reading a single character from a signaled
+ // filedescriptor
+ senf::IGNORE( read(timerPipe_[0], &data, sizeof(data)) );
timeoutEnabled_ = false;
}
///////////////////////////////////////////////////////////////////////////
// senf::scheduler::detail::TimerFDTimerSource
-#ifdef HAVE_TIMERFD
+#ifdef HAVE_TIMERFD_CREATE
prefix_ senf::scheduler::detail::TimerFDTimerSource::TimerFDTimerSource()
: timerfd_ (-1), timeoutEnabled_ (false), timeout_ (0)
{
prefix_ void senf::scheduler::detail::TimerFDTimerSource::signal(int events)
{
uint64_t expirations (0);
- read(timerfd_, &expirations, sizeof(expirations));
+ // We ignore the return value since we ignore the value read anyways
+ senf::IGNORE( read(timerfd_, &expirations, sizeof(expirations)) );
}
prefix_ void senf::scheduler::detail::TimerFDTimerSource::reschedule()
#undef prefix_
//#include "TimerSource.mpp"
-\f
+
// Local Variables:
// mode: c++
// fill-column: 100