diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/dlt-daemon.c | 62 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 4 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_connection.c | 2 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_event_handler.c | 10 |
4 files changed, 41 insertions, 37 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index 350e594..c09a809 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -289,7 +289,7 @@ int option_handling(DltDaemonLocal *daemon_local, int argc, char *argv[]) else if (isprint (optopt)) fprintf (stderr, "Unknown option `-%c'.\n", optopt); else - fprintf (stderr, "Unknown option character `\\x%x'.\n", optopt); + fprintf (stderr, "Unknown option character `\\x%x'.\n", (uint32_t)optopt); /* unknown or wrong option used, show usage information and terminate */ usage(); @@ -376,7 +376,7 @@ int option_file_parser(DltDaemonLocal *daemon_local) daemon_local->flags.offlineLogstorageCacheSize); strncpy(daemon_local->flags.ctrlSockPath, DLT_DAEMON_DEFAULT_CTRL_SOCK_PATH, - sizeof(daemon_local->flags.ctrlSockPath) - 1); + sizeof(daemon_local->flags.ctrlSockPath)); #ifdef DLT_DAEMON_USE_UNIX_SOCKET_IPC snprintf(daemon_local->flags.appSockPath, DLT_IPC_PATH_MAX, "%s/dlt", DLT_USER_IPC_PATH); @@ -390,7 +390,7 @@ int option_file_parser(DltDaemonLocal *daemon_local) daemon_local->flags.gatewayMode = 0; strncpy(daemon_local->flags.gatewayConfigFile, DLT_GATEWAY_CONFIG_PATH, - DLT_DAEMON_FLAG_MAX - 1); + DLT_DAEMON_FLAG_MAX); daemon_local->flags.autoResponseGetLogInfoOption = 7; daemon_local->flags.contextLogLevel = DLT_LOG_INFO; daemon_local->flags.contextTraceStatus = DLT_TRACE_STATUS_OFF; @@ -2270,7 +2270,7 @@ int dlt_daemon_process_app_connect( } /* check if file file descriptor was already used, and make it invalid if it - * is reused. This prevents sending messages to wrong file descriptor */ + * is reused. This prevents sending messages to wrong file descriptor */ dlt_daemon_applications_invalidate_fd(daemon, daemon->ecuid, in_sock, verbose); dlt_daemon_contexts_invalidate_fd(daemon, daemon->ecuid, in_sock, verbose); @@ -2370,7 +2370,7 @@ static int dlt_daemon_process_user_message_not_sup(DltDaemon *daemon, PRINT_FUNCTION_VERBOSE(verbose); - dlt_vlog(LOG_ERR, "Invalid user message type received: %d!\n", + dlt_vlog(LOG_ERR, "Invalid user message type received: %u!\n", userheader->message); /* remove user header */ @@ -2701,7 +2701,7 @@ int dlt_daemon_process_user_message_register_context(DltDaemon *daemon, len = userctxt.description_length; if (len > DLT_DAEMON_DESCSIZE) { - dlt_vlog(LOG_WARNING, "Context description exceeds limit: %d\n", len); + dlt_vlog(LOG_WARNING, "Context description exceeds limit: %u\n", len); len = DLT_DAEMON_DESCSIZE; } @@ -2746,22 +2746,26 @@ int dlt_daemon_process_user_message_register_context(DltDaemon *daemon, } /* Set log level */ - if (userctxt.log_level == DLT_USER_LOG_LEVEL_NOT_SET) + if (userctxt.log_level == DLT_USER_LOG_LEVEL_NOT_SET) { userctxt.log_level = DLT_LOG_DEFAULT; - else - /* Plausibility check */ - if ((userctxt.log_level < DLT_LOG_DEFAULT) || - (userctxt.log_level > DLT_LOG_VERBOSE)) - return -1; + } else { + /* Plausibility check */ + if ((userctxt.log_level < DLT_LOG_DEFAULT) || + (userctxt.log_level > DLT_LOG_VERBOSE)) { + return -1; + } + } /* Set trace status */ - if (userctxt.trace_status == DLT_USER_TRACE_STATUS_NOT_SET) + if (userctxt.trace_status == DLT_USER_TRACE_STATUS_NOT_SET) { userctxt.trace_status = DLT_TRACE_STATUS_DEFAULT; - else - /* Plausibility check */ - if ((userctxt.trace_status < DLT_TRACE_STATUS_DEFAULT) || - (userctxt.trace_status > DLT_TRACE_STATUS_ON)) - return -1; + } else { + /* Plausibility check */ + if ((userctxt.trace_status < DLT_TRACE_STATUS_DEFAULT) || + (userctxt.trace_status > DLT_TRACE_STATUS_ON)) { + return -1; + } + } context = dlt_daemon_context_add(daemon, userctxt.apid, @@ -3331,37 +3335,37 @@ static void *timer_thread(void *data) int pexit = 0; unsigned int sleep_ret = 0; - DltDaemonPeriodicData* timer_data = (DltDaemonPeriodicData*) data; + DltDaemonPeriodicData* timer_thread_data = (DltDaemonPeriodicData*) data; /* Timer will start in starts_in sec*/ - if ((sleep_ret = sleep(timer_data->starts_in))) { + if ((sleep_ret = sleep(timer_thread_data->starts_in))) { dlt_vlog(LOG_NOTICE, "Sleep remains [%u] for starting!" "Stop thread of timer [%d]\n", - sleep_ret, timer_data->timer_id); - close_pipes(dlt_timer_pipes[timer_data->timer_id]); + sleep_ret, timer_thread_data->timer_id); + close_pipes(dlt_timer_pipes[timer_thread_data->timer_id]); return NULL; } while (1) { - if (0 > write(dlt_timer_pipes[timer_data->timer_id][1], "1", 1)) { + if (0 > write(dlt_timer_pipes[timer_thread_data->timer_id][1], "1", 1)) { dlt_vlog(LOG_ERR, "Failed to send notification for timer [%s]!\n", - dlt_timer_names[timer_data->timer_id]); + dlt_timer_names[timer_thread_data->timer_id]); pexit = 1; } if (pexit || g_exit) { dlt_vlog(LOG_NOTICE, "Received signal!" "Stop thread of timer [%d]\n", - timer_data->timer_id); - close_pipes(dlt_timer_pipes[timer_data->timer_id]); + timer_thread_data->timer_id); + close_pipes(dlt_timer_pipes[timer_thread_data->timer_id]); return NULL; } - if ((sleep_ret = sleep(timer_data->period_sec))) { + if ((sleep_ret = sleep(timer_thread_data->period_sec))) { dlt_vlog(LOG_NOTICE, "Sleep remains [%u] for interval!" "Stop thread of timer [%d]\n", - sleep_ret, timer_data->timer_id); - close_pipes(dlt_timer_pipes[timer_data->timer_id]); + sleep_ret, timer_thread_data->timer_id); + close_pipes(dlt_timer_pipes[timer_thread_data->timer_id]); return NULL; } } diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 2724973..becd061 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -1028,7 +1028,7 @@ void dlt_daemon_control_get_log_info(int sock, if (verbose) dlt_vlog(LOG_DEBUG, - "Allocate %d bytes for response msg databuffer\n", + "Allocate %u bytes for response msg databuffer\n", resp.datasize); /* Allocate buffer for response message */ @@ -2587,7 +2587,7 @@ void dlt_daemon_control_service_logstorage(int sock, /* Check for cache synchronization request from log storage ctrl app */ else if (req->connection_type == DLT_OFFLINE_LOGSTORAGE_SYNC_CACHES) { - int ret = 0; + ret = 0; if (device_index == -1) { /* sync all Logstorage devices */ diff --git a/src/daemon/dlt_daemon_connection.c b/src/daemon/dlt_daemon_connection.c index a438c03..805afed 100644 --- a/src/daemon/dlt_daemon_connection.c +++ b/src/daemon/dlt_daemon_connection.c @@ -396,7 +396,7 @@ int dlt_connection_create(DltDaemonLocal *daemon_local, temp->receiver = dlt_connection_get_receiver(daemon_local, type, fd); if (!temp->receiver) { - dlt_vlog(LOG_CRIT, "Unable to get receiver from %d connection.\n", + dlt_vlog(LOG_CRIT, "Unable to get receiver from %u connection.\n", type); free(temp); return -1; diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c index 0d463da..db5767a 100644 --- a/src/daemon/dlt_daemon_event_handler.c +++ b/src/daemon/dlt_daemon_event_handler.c @@ -246,7 +246,7 @@ int dlt_daemon_handle_event(DltEventHandler *pEvent, callback = dlt_connection_get_callback(con); if (!callback) { - dlt_vlog(LOG_CRIT, "Unable to find function for %d handle type.\n", + dlt_vlog(LOG_CRIT, "Unable to find function for %u handle type.\n", type); return -1; } @@ -256,7 +256,7 @@ int dlt_daemon_handle_event(DltEventHandler *pEvent, daemon_local, con->receiver, daemon_local->flags.vflag) == -1) { - dlt_vlog(LOG_CRIT, "Processing from %d handle type failed!\n", + dlt_vlog(LOG_CRIT, "Processing from %u handle type failed!\n", type); return -1; } @@ -402,7 +402,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl, case ACTIVE: if (activation_type == DEACTIVATE) { - dlt_vlog(LOG_INFO, "Deactivate connection type: %d\n", con->type); + dlt_vlog(LOG_INFO, "Deactivate connection type: %u\n", con->type); dlt_event_handler_disable_fd(evhdl, con->receiver->fd); @@ -416,7 +416,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl, case INACTIVE: if (activation_type == ACTIVATE) { - dlt_vlog(LOG_INFO, "Activate connection type: %d\n", con->type); + dlt_vlog(LOG_INFO, "Activate connection type: %u\n", con->type); dlt_event_handler_enable_fd(evhdl, con->receiver->fd, @@ -427,7 +427,7 @@ int dlt_connection_check_activate(DltEventHandler *evhdl, break; default: - dlt_vlog(LOG_ERR, "Unknown connection status: %d\n", con->status); + dlt_vlog(LOG_ERR, "Unknown connection status: %u\n", con->status); return -1; } |