*/
#include <stddef.h>
#include <dpl/waitable_event.h>
+#include <dpl/log/wrt_log.h>
#include <sys/select.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <errno.h>
namespace DPL {
WaitableEvent::WaitableEvent()
}
if (fcntl(m_pipe[0], F_SETFL, O_NONBLOCK |
- fcntl(m_pipe[0], F_GETFL)) == -1)
- {
+ fcntl(m_pipe[0], F_GETFL)) == -1) {
Throw(Exception::CreateFailed);
}
}
WaitableEvent::~WaitableEvent()
{
if (TEMP_FAILURE_RETRY(close(m_pipe[0])) == -1) {
- Throw(Exception::DestroyFailed);
+ WrtLogW("Fail to close fd");
}
if (TEMP_FAILURE_RETRY(close(m_pipe[1])) == -1) {
- Throw(Exception::DestroyFailed);
+ WrtLogW("Fail to close fd");
}
}
char data = 0;
if (TEMP_FAILURE_RETRY(write(m_pipe[1], &data, 1)) != 1) {
- Throw(Exception::SignalFailed);
+ WrtLogW("Fail to signal fd");
}
}
char data;
if (TEMP_FAILURE_RETRY(read(m_pipe[0], &data, 1)) != 1) {
- Throw(Exception::ResetFailed);
+ WrtLogW("Fail to reset fd");
}
}
} // namespace DPL