From: Jan Olszak Date: Mon, 10 Dec 2012 08:16:07 +0000 (+0100) Subject: [Prevent] Handle chmod return value X-Git-Tag: submit/trunk/20121213.022635~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c088a417ecc3f77de95d00f1bbdd04316d069db;p=platform%2Fframework%2Fweb%2Fwrt-commons.git [Prevent] Handle chmod return value [Issue#] Return value not handled. [Bug] N/A [Cause] N/A [Solution] Log error on chmod fail. [Verification] Build commons. Change-Id: I7196aa7da0307993a49812e29a6ff6a7189c8b86 --- diff --git a/modules/socket/src/unix_socket.cpp b/modules/socket/src/unix_socket.cpp index 29fae2b..3dd905c 100644 --- a/modules/socket/src/unix_socket.cpp +++ b/modules/socket/src/unix_socket.cpp @@ -30,6 +30,7 @@ #include #include #include +#include namespace DPL { @@ -102,8 +103,9 @@ void UnixSocket::Bind(const Address &address) GenericSocket::Bind(address); // Always set proper permissions to the socket file - chmod(address.GetAddress().c_str(), 0777); + if(chmod(address.GetAddress().c_str(), 0777)<0){ + LogError("Error setting permissions to the socket file. Errno " << strerror(errno)); + } } - } } // namespace DPL