summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_event_handler.c
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2019-06-07 17:02:18 +0900
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-07-24 07:53:41 +0900
commitc32b3a39e484c1fc5ff625c752c6beeb9426ff85 (patch)
treee5cdb0088d8e988d6079e83dd2b7f2206e4bdb07 /src/daemon/dlt_daemon_event_handler.c
parent5c8f88d1225897ac8613ad3d4ca26c861dcc299b (diff)
downloadDLT-daemon-c32b3a39e484c1fc5ff625c752c6beeb9426ff85.tar.gz
Correct sa findings
dlt_offline_logstorage.c - Parameter to isdigit is not correct - Handle the size of memset() and strncpy() properly dlt-test-stress-user.c - Parameter d is duplicated dlt_env_ll.c - Parameter env is used before NULL check - Remove redundant line dlt-control-common.c dlt_daemon_event_handler.c - Do not use NULL variable to print log dlt_config_file_parser.c - Remove unnecessary loop dlt_daemon_client.c - Return error in NULL check dlt_user.c - Free allocated memory in error case Related commit: 5c8f88d logstorage: fix compile error Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/daemon/dlt_daemon_event_handler.c')
-rw-r--r--src/daemon/dlt_daemon_event_handler.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c
index 2e3d758..1611f7b 100644
--- a/src/daemon/dlt_daemon_event_handler.c
+++ b/src/daemon/dlt_daemon_event_handler.c
@@ -393,16 +393,8 @@ int dlt_connection_check_activate(DltEventHandler *evhdl,
DltConnection *con,
int activation_type)
{
- char local_str[DLT_DAEMON_TEXTBUFSIZE] = { '\0' };
-
if (!evhdl || !con || !con->receiver) {
- snprintf(local_str,
- DLT_DAEMON_TEXTBUFSIZE,
- "%s: wrong parameters (%p %p).\n",
- __func__,
- evhdl,
- con);
- dlt_log(LOG_ERR, local_str);
+ dlt_vlog(LOG_ERR, "%s: wrong parameters.\n", __func__);
return -1;
}
@@ -410,11 +402,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl,
case ACTIVE:
if (activation_type == DEACTIVATE) {
- snprintf(local_str,
- DLT_DAEMON_TEXTBUFSIZE,
- "Deactivate connection type: %d\n",
- con->type);
- dlt_log(LOG_INFO, local_str);
+ dlt_vlog(LOG_INFO, "Deactivate connection type: %d\n", con->type);
dlt_event_handler_disable_fd(evhdl, con->receiver->fd);
@@ -428,11 +416,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl,
case INACTIVE:
if (activation_type == ACTIVATE) {
- snprintf(local_str,
- DLT_DAEMON_TEXTBUFSIZE,
- "Activate connection type: %d\n",
- con->type);
- dlt_log(LOG_INFO, local_str);
+ dlt_vlog(LOG_INFO, "Activate connection type: %d\n", con->type);
dlt_event_handler_enable_fd(evhdl,
con->receiver->fd,
@@ -443,11 +427,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl,
break;
default:
- snprintf(local_str,
- DLT_DAEMON_TEXTBUFSIZE,
- "Unknown connection status: %d\n",
- con->status);
- dlt_log(LOG_ERR, local_str);
+ dlt_vlog(LOG_ERR, "Unknown connection status: %d\n", con->status);
return -1;
}