Change-Id: Ifed8405a3c9bc0867319b6250e13fe5aa23f4dde
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
AbstractSocket::AbstractSocket(std::string path)
: path_(std::move(path)), fd_(-1), addr_{} {}
-AbstractSocket::AbstractSocket(int fd) : fd_(fd), addr_{} {}
+AbstractSocket::AbstractSocket(int fd) : fd_(fd), addr_{} {
+ GetFdInfo();
+}
AbstractSocket::~AbstractSocket() {
Disconnect();
protected:
void SetOption();
int Create();
+
+ private:
void GetFdInfo();
protected:
namespace pkgmgr_common {
namespace socket {
-DataSocket::DataSocket(int fd) : AbstractSocket(fd) {
- GetFdInfo();
-}
+DataSocket::DataSocket(int fd) : AbstractSocket(fd) {}
} // namespace socket
} // namespace pkgmgr_common
std::vector<std::string> GetPrivileges(pkgmgr_common::ReqType type) {
std::vector<std::string> ret;
- if (type == pkgmgr_common::SET_CERT_INFO) {
+ if (type == pkgmgr_common::SET_CERT_INFO)
ret.emplace_back(PRIVILEGE_PACKAGE_MANAGER_ADMIN);
- } else if (type == pkgmgr_common::SET_PKG_INFO) {
+ else if (type == pkgmgr_common::SET_PKG_INFO)
ret.emplace_back(PRIVILEGE_PACKAGE_MANAGER_ADMIN);
- }
return ret;
}