From 237aeb9c0a720c59a6881f0f7922f4ca4cd3540f Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Fri, 14 Apr 2017 17:22:54 +0900 Subject: [PATCH] sensord: fix bug with invalid character(!) Change-Id: Ib35b0f4c2ea3dc1d9c169ef24fa533a99d21c9c8 Signed-off-by: kibak.yoon --- src/shared/channel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/channel.cpp b/src/shared/channel.cpp index b56d49e..8dc25ac 100644 --- a/src/shared/channel.cpp +++ b/src/shared/channel.cpp @@ -25,6 +25,8 @@ #include "sensor_log.h" +#define SYSTEMD_SOCK_BUF_SIZE 40000 + using namespace ipc; class send_event_handler : public event_handler @@ -146,7 +148,7 @@ bool channel::send(message *msg) /* TODO: check buffer size(is there any linux api for this?) */ int cur_buffer_size = m_socket->get_current_buffer_size(); - retvm_if(!cur_buffer_size > 40000, false, "Failed to send data"); + retvm_if(cur_buffer_size > SYSTEMD_SOCK_BUF_SIZE, false, "Failed to send data"); send_event_handler *handler = new(std::nothrow) send_event_handler(this, msg); retvm_if(!handler, false, "Failed to allocate memory"); -- 2.7.4