diff --git a/src/common/session.cpp b/src/common/session.cpp index 724c8fe6130e829164806f7ee45de204dbef75da..2283fc74b83ce0c8f92c8fbb14f374c6242cb0a3 100644 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -18,7 +18,9 @@ namespace Hdc { HdcSessionBase::HdcSessionBase(bool serverOrDaemonIn) { - // server/daemon common initialize + // server/daemon common initialization logic + string threadNum = std::to_string(SIZE_THREAD_POOL); + uv_os_setenv("UV_THREADPOOL_SIZE", threadNum.c_str()); uv_loop_init(&loopMain); WRITE_LOG(LOG_DEBUG, "loopMain init"); uv_rwlock_init(&mainAsync); @@ -28,16 +30,6 @@ HdcSessionBase::HdcSessionBase(bool serverOrDaemonIn) ctxUSB = nullptr; wantRestart = false; - // server/daemon common set - string threadNum = std::to_string(SIZE_THREAD_POOL); - uv_os_setenv("UV_THREADPOOL_SIZE", threadNum.c_str()); -#ifndef _WIN32 - // global signal detect - umask(0); - signal(SIGPIPE, SIG_IGN); // SIG_DFL - // prevent zoombie process, let 'init' process do process's clear - signal(SIGCHLD, SIG_IGN); -#endif #ifdef HDC_HOST if (serverOrDaemon) { libusb_init((libusb_context **)&ctxUSB); diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 542908e90d813fe0cdfd649d922d4661761534be..820c383a6e4529b917d849c2a2043dd2590f37cb 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -36,7 +36,7 @@ bool ForkChildCheck(int argc, const char *argv[]) // hdcd -fork #fork char modeSet[BUF_SIZE_TINY] = ""; Base::GetHdcProperty("persist.hdc.mode", modeSet, BUF_SIZE_TINY); - Base::PrintMessage("Background mode, persist.hdc.mode:[%s]", modeSet); + Base::PrintMessage("Background mode, persist.hdc.mode"); string workMode = modeSet; workMode = Base::Trim(workMode); if (workMode == CMDSTR_TMODE_TCP) {