From 1f925c555f909249d3551c1e64b60adf9e2738de Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Wed, 15 Jun 2022 10:24:21 +0900 Subject: [PATCH] Modify to listen only G_IO_IN event Change-Id: Iab1098f361392c2224ce0ab244eea0ad151a8212 Signed-off-by: Ilho Kim --- src/server/runner.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/server/runner.cc b/src/server/runner.cc index 03b5be4..4e4589b 100644 --- a/src/server/runner.cc +++ b/src/server/runner.cc @@ -52,8 +52,7 @@ Runner::Runner(unsigned int thread_num) { CynaraChecker::GetInst().Init(); server_ = std::make_unique(SOCK_PATH); thread_pool_ = std::make_unique(thread_num_); - auto condition = static_cast( - G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL); + auto condition = static_cast(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()); @@ -73,13 +72,6 @@ Runner::~Runner() { } int Runner::OnReceiveRequest(int fd, GIOCondition cond, void* user_data) { - if (static_cast(cond) & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { - LOG(ERROR) << "Invalid condition fd:" << fd - << ", condition:" << static_cast(cond); - abort(); - return G_SOURCE_REMOVE; - } - auto runner = static_cast(user_data); int client_fd = runner->server_->Accept(); if (client_fd < 0) { -- 2.7.4