From b8ffd7662428b4baff92a0c8271e84c2b55ce47b Mon Sep 17 00:00:00 2001 From: "sangwan.kwon" Date: Mon, 30 May 2016 14:27:13 +0900 Subject: Apply tizen coding rule * It depends on cpp rule checker(version 160520) Change-Id: Ica308e1296be4f3567725fdb004f3bae8a456a0c --- src/common/eventfd.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common/eventfd.cpp') diff --git a/src/common/eventfd.cpp b/src/common/eventfd.cpp index 1828b1f..a3dba42 100644 --- a/src/common/eventfd.cpp +++ b/src/common/eventfd.cpp @@ -33,6 +33,7 @@ namespace CCHECKER { EventFD::EventFD(unsigned int initval, int flags) { fd = ::eventfd(initval, flags); + if (fd == -1) { throw std::logic_error("EventFd from constructor is failed!!"); } @@ -48,6 +49,7 @@ EventFD::~EventFD() void EventFD::send() { const std::uint64_t val = 1; + if (::write(fd, &val, sizeof(val)) == -1) { throw std::logic_error("EventFd send to fd is failed!!"); } @@ -56,6 +58,7 @@ void EventFD::send() void EventFD::receive() { std::uint64_t val; + if (::read(fd, &val, sizeof(val)) == -1) { throw std::logic_error("EventFd read to fd is failed!!"); } -- cgit v1.2.3