CynaraChecker::GetInst().Init();
server_ = std::make_unique<pkgmgr_common::socket::ServerSocket>(SOCK_PATH);
thread_pool_ = std::make_unique<WorkerThread>(thread_num_);
- auto condition = static_cast<GIOCondition>(
- G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL);
+ auto condition = static_cast<GIOCondition>(G_IO_IN);
sid_ = g_unix_fd_add(server_->GetFd(), condition, OnReceiveRequest, this);
pkgmgr_common::SystemLocale::GetInst().RegisterEvent(this);
thread_pool_->SetLocale(pkgmgr_common::SystemLocale::GetInst().Get());
}
int Runner::OnReceiveRequest(int fd, GIOCondition cond, void* user_data) {
- if (static_cast<int>(cond) & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
- LOG(ERROR) << "Invalid condition fd:" << fd
- << ", condition:" << static_cast<int>(cond);
- abort();
- return G_SOURCE_REMOVE;
- }
-
auto runner = static_cast<Runner*>(user_data);
int client_fd = runner->server_->Accept();
if (client_fd < 0) {