From 591dff7fae9f7b8fd1481faabab6aba057f45c87 Mon Sep 17 00:00:00 2001 From: shiminghui Date: Fri, 26 Apr 2024 10:31:32 +0800 Subject: [PATCH] test gn build Signed-off-by: shiminghui --- frameworks/libhilog/BUILD.gn | 2 +- frameworks/libhilog/base/hilog_base.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frameworks/libhilog/BUILD.gn b/frameworks/libhilog/BUILD.gn index b4e3821..86b485a 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -135,12 +135,12 @@ ohos_source_set("libhilog_base_source") { vsnprintf_sources = [ "$vsnprintf_root/vsnprintf_s_p.c" ] sources = [ "$libhilog_base_root/hilog_base.c" ] - sources += vsnprintf_sources defines = [ "__RECV_MSG_WITH_UCRED_", "HILOG_PROHIBIT_ALLOCATION", ] + sources += vsnprintf_sources public_configs = [ ":libhilog_base_config" ] configs = [ ":libhilog_base_config" ] diff --git a/frameworks/libhilog/base/hilog_base.c b/frameworks/libhilog/base/hilog_base.c index 7e344f6..02e2756 100644 --- a/frameworks/libhilog/base/hilog_base.c +++ b/frameworks/libhilog/base/hilog_base.c @@ -38,6 +38,10 @@ static int SendMessage(HilogMsg *header, const char *tag, uint16_t tagLen, const // The hilogbase interface cannot has mutex, so need to re-open and connect to the socketof the hilogd // server each time you write logs. Althougth there is some overhead, you can only do this. int socketFd = TEMP_FAILURE_RETRY(socket(AF_UNIX, SOCKET_TYPE, 0)); + if (tagLen == 0) { + // only test + tagLen = 0; + } if (socketFd < 0) { dprintf(ERROR_FD, "HiLogBase: Can't create socket! Errno: %d\n", errno); return socketFd; -- Gitee