summaryrefslogtreecommitdiff
path: root/src/kpi/dlt-kpi.c
diff options
context:
space:
mode:
authorAmber Bhardwaj <amber.bhardwaj10@gmail.com>2017-06-16 11:08:42 +0530
committerChristoph Lipka <clipka@users.noreply.github.com>2017-06-16 07:38:42 +0200
commitcf65615d35b7c0d3cae3239c53374d841d9a175d (patch)
tree16693b958e879a36c737cb50f13fa5b3ae8e7ce2 /src/kpi/dlt-kpi.c
parentb91b38534e5276db69ffbf938177c227b01c65ad (diff)
downloadDLT-daemon-cf65615d35b7c0d3cae3239c53374d841d9a175d.tar.gz
Input parameter check & Error message modification (#15)
* Update dlt-kpi-process.c Added input param checking and added return value in non-void functions. * Update dlt-kpi.c Added Input param checking and added return values in non-void functions. * Input parameter check and Error msg modification Added null pointer checking Added input parameter checking Added return values in non-void functions Added proper error message for debugging purpose Signed-off-by: amberbhardwaj <amber.bhardwaj10@gmail.com>
Diffstat (limited to 'src/kpi/dlt-kpi.c')
-rw-r--r--src/kpi/dlt-kpi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/kpi/dlt-kpi.c b/src/kpi/dlt-kpi.c
index f315058..8ba019e 100644
--- a/src/kpi/dlt-kpi.c
+++ b/src/kpi/dlt-kpi.c
@@ -124,6 +124,8 @@ int main(int argc, char **argv)
dlt_kpi_free_process_lists();
printf("Done.\n");
+
+ return 0;
}
void dlt_kpi_init_sigterm_handler()
@@ -213,7 +215,7 @@ DltReturnValue dlt_kpi_log_list(DltKpiProcessList *list, DltReturnValue(*process
{
if(list == NULL || process_callback == NULL || title == NULL)
{
- fprintf(stderr, "dlt_kpi_log_list(): Nullpointer parameter\n");
+ fprintf(stderr, "%s: Invalid Parameter (NULL)\n", __func__);
return DLT_RETURN_WRONG_PARAMETER;
}
@@ -232,13 +234,13 @@ DltReturnValue dlt_kpi_log_list(DltKpiProcessList *list, DltReturnValue(*process
if((ret = dlt_user_log_write_start(&kpi_ctx, &data, config.log_level)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_start() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_start() returned error.\n", __func__);
return ret;
}
if((ret = dlt_user_log_write_string(&data, title)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_string() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_string() returned error.\n", __func__);
return ret;
}
@@ -252,19 +254,19 @@ DltReturnValue dlt_kpi_log_list(DltKpiProcessList *list, DltReturnValue(*process
/* Log buffer full => Write log and start new one*/
if((ret = dlt_user_log_write_finish(&data)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_finish() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_finish() returned error.\n",__func__);
return ret;
}
if((ret = dlt_user_log_write_start(&kpi_ctx, &data, config.log_level)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_start() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_start() returned error.\n",__func__);
return ret;
}
if((ret = dlt_user_log_write_string(&data, title)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_string() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_string() returned error.\n",__func__);
return ret;
}
}
@@ -282,7 +284,7 @@ DltReturnValue dlt_kpi_log_list(DltKpiProcessList *list, DltReturnValue(*process
if((ret = dlt_user_log_write_finish(&data)) < DLT_RETURN_OK)
{
- fprintf(stderr, "dlt_kpi_log_list(): dlt_user_log_write_finish() returned error.\n");
+ fprintf(stderr, "%s: dlt_user_log_write_finish() returned error.\n",__func__);
return ret;
}