tizen 2.4 release
[framework/web/wrt-commons.git] / modules / core / src / waitable_event.cpp
similarity index 88%
rename from modules_wearable/core/src/waitable_event.cpp
rename to modules/core/src/waitable_event.cpp
index 4808896..3530d46 100644 (file)
  */
 #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()
@@ -35,8 +35,7 @@ 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);
     }
 }
@@ -44,11 +43,11 @@ WaitableEvent::WaitableEvent()
 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");
     }
 }
 
@@ -62,7 +61,7 @@ void WaitableEvent::Signal() const
     char data = 0;
 
     if (TEMP_FAILURE_RETRY(write(m_pipe[1], &data, 1)) != 1) {
-        Throw(Exception::SignalFailed);
+        WrtLogW("Fail to signal fd");
     }
 }
 
@@ -71,7 +70,7 @@ void WaitableEvent::Reset() const
     char data;
 
     if (TEMP_FAILURE_RETRY(read(m_pipe[0], &data, 1)) != 1) {
-        Throw(Exception::ResetFailed);
+        WrtLogW("Fail to reset fd");
     }
 }
 } // namespace DPL