summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/dlt_common.c')
-rw-r--r--src/shared/dlt_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index adda5db..57455fa 100644
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -1814,11 +1814,11 @@ void dlt_print_with_attributes(bool state)
print_with_attributes = state;
}
-void dlt_log_init(int mode)
+DltReturnValue dlt_log_init(int mode)
{
if ((mode < DLT_LOG_TO_CONSOLE) || (mode > DLT_LOG_DROPPED)) {
dlt_vlog(LOG_WARNING, "Wrong parameter for mode: %d\n", mode);
- return;
+ return DLT_RETURN_WRONG_PARAMETER;
}
logging_mode = mode;
@@ -1829,14 +1829,16 @@ void dlt_log_init(int mode)
if (logging_handle == NULL) {
dlt_user_printf("Internal log file %s cannot be opened!\n", logging_filename);
- return;
+ return DLT_RETURN_ERROR;
}
}
+
+ return DLT_RETURN_OK;
}
void dlt_log_free(void)
{
- if (logging_mode == DLT_LOG_TO_FILE)
+ if (logging_mode == DLT_LOG_TO_FILE && logging_handle)
fclose(logging_handle);
}