summaryrefslogtreecommitdiff
path: root/src/lib/dlt_user.c
diff options
context:
space:
mode:
authorManikandan C <mchockalingam@de.adit-jv.com>2018-12-19 16:10:41 +0100
committerChristoph Lipka <clipka@users.noreply.github.com>2018-12-21 10:16:46 +0100
commitab105d1671789fc9bd649f7e9ce3e6af22d30f0e (patch)
tree1cb0a74e08cad0723cd3c601f0fa1842be9d96f2 /src/lib/dlt_user.c
parentd34dc8fd10ff4dec56d5a221443f91fc26d10d11 (diff)
downloadDLT-daemon-ab105d1671789fc9bd649f7e9ce3e6af22d30f0e.tar.gz
Cleanup of unit test fixes
Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r--src/lib/dlt_user.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index ceea2ea..418e1cf 100644
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -1064,16 +1064,11 @@ DltReturnValue dlt_register_context(DltContext *handle, const char *contextid, c
}
}
- DLT_SEM_LOCK();
-
if ((contextid == NULL) || (contextid[0] == '\0'))
{
- DLT_SEM_FREE();
return DLT_RETURN_WRONG_PARAMETER;
}
- DLT_SEM_FREE();
-
return dlt_register_context_ll_ts(handle, contextid, description, DLT_USER_LOG_LEVEL_NOT_SET, DLT_USER_TRACE_STATUS_NOT_SET);
}
@@ -1091,12 +1086,7 @@ DltReturnValue dlt_register_context_ll_ts_llccb(DltContext *handle,
int envLogLevel = DLT_USER_LOG_LEVEL_NOT_SET;
//check nullpointer
- if (!handle)
- {
- return DLT_RETURN_WRONG_PARAMETER;
- }
-
- if ((contextid == NULL) || (contextid[0] == '\0'))
+ if ((handle ==NULL) || (contextid == NULL) || (contextid[0] == '\0'))
{
return DLT_RETURN_WRONG_PARAMETER;
}
@@ -1173,7 +1163,7 @@ DltReturnValue dlt_register_context_ll_ts_llccb(DltContext *handle,
old_ll_ts = dlt_user.dlt_ll_ts;
old_max_entries = dlt_user.dlt_ll_ts_max_num_entries;
- dlt_user.dlt_ll_ts_max_num_entries = ((dlt_user.dlt_ll_ts_num_entries
+ dlt_user.dlt_ll_ts_max_num_entries = ((dlt_user.dlt_ll_ts_num_entries
/ DLT_USER_CONTEXT_ALLOC_SIZE) + 1)
* DLT_USER_CONTEXT_ALLOC_SIZE;
dlt_user.dlt_ll_ts = (dlt_ll_ts_type*) malloc(sizeof(dlt_ll_ts_type)*
@@ -1294,8 +1284,10 @@ DltReturnValue dlt_register_context_ll_ts_llccb(DltContext *handle,
return dlt_user_log_send_register_context(&log);
}
-DltReturnValue dlt_register_context_ll_ts(DltContext *handle, const char *contextid,
- const char * description, int loglevel,
+DltReturnValue dlt_register_context_ll_ts(DltContext *handle,
+ const char *contextid,
+ const char * description,
+ int loglevel,
int tracestatus)
{
return dlt_register_context_ll_ts_llccb(handle,
@@ -3370,7 +3362,7 @@ DltReturnValue dlt_log_string(DltContext *handle, DltLogLevelType loglevel, cons
if (dlt_user_log_write_finish(&log) < DLT_RETURN_OK)
{
- return DLT_RETURN_ERROR;
+ ret = DLT_RETURN_ERROR;
}
}
@@ -3399,7 +3391,7 @@ DltReturnValue dlt_log_string_int(DltContext *handle, DltLogLevelType loglevel,
if (dlt_user_log_write_finish(&log) < DLT_RETURN_OK)
{
- return DLT_RETURN_ERROR;
+ ret = DLT_RETURN_ERROR;
}
}
@@ -3428,7 +3420,7 @@ DltReturnValue dlt_log_string_uint(DltContext *handle, DltLogLevelType loglevel,
if (dlt_user_log_write_finish(&log) < DLT_RETURN_OK)
{
- return DLT_RETURN_ERROR;
+ ret = DLT_RETURN_ERROR;
}
}
@@ -4652,8 +4644,8 @@ DltReturnValue dlt_user_log_check_user_message(void)
}
else
{
- dlt_log(LOG_WARNING,"malloc failed!\n");
DLT_SEM_FREE();
+ dlt_log(LOG_WARNING,"malloc failed!\n");
return DLT_RETURN_ERROR;
}
break;