summaryrefslogtreecommitdiff
path: root/src/system/dlt-system-logfile.c
diff options
context:
space:
mode:
authorSimon Brandner <simon.brandner@partner.bmw.de>2013-01-28 12:14:06 +0100
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2013-07-19 16:54:38 +0200
commite2943ff4cf2d7d2da4000e2ca35663a7c83675d7 (patch)
tree1a710a70a5190dacdb26c02da6cb570271f5d506 /src/system/dlt-system-logfile.c
parent733a1111254882aec6ebc9c90bb690aaee3f2773 (diff)
downloadDLT-daemon-e2943ff4cf2d7d2da4000e2ca35663a7c83675d7.tar.gz
Semaphores and Pointer passing insteasd by value and otehr coverity issue fixes
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/system/dlt-system-logfile.c')
-rw-r--r--src/system/dlt-system-logfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/system/dlt-system-logfile.c b/src/system/dlt-system-logfile.c
index 50964f2..1354b83 100644
--- a/src/system/dlt-system-logfile.c
+++ b/src/system/dlt-system-logfile.c
@@ -56,7 +56,7 @@ DLT_IMPORT_CONTEXT(dltsystem);
extern DltSystemThreads threads;
DltContext logfileContext[DLT_SYSTEM_LOG_FILE_MAX];
-void send_file(LogFileOptions fileopt, int n)
+void send_file(LogFileOptions const *fileopt, int n)
{
DLT_LOG(dltsystem, DLT_LOG_DEBUG,
DLT_STRING("dlt-system-logfile, sending file."));
@@ -66,7 +66,7 @@ void send_file(LogFileOptions fileopt, int n)
int bytes;
int seq = 1;
- pFile = fopen(fileopt.Filename[n],"r");
+ pFile = fopen((*fileopt).Filename[n],"r");
if(pFile != NULL)
{
@@ -91,19 +91,19 @@ void send_file(LogFileOptions fileopt, int n)
{
DLT_LOG(dltsystem, DLT_LOG_ERROR,
DLT_STRING("dlt-system-logfile, failed to open file."),
- DLT_STRING(fileopt.Filename[n]));
+ DLT_STRING((*fileopt).Filename[n]));
}
}
-void register_contexts(LogFileOptions fileopts)
+void register_contexts(LogFileOptions const *fileopts)
{
DLT_LOG(dltsystem, DLT_LOG_DEBUG,
DLT_STRING("dlt-system-logfile, registering file contexts."));
int i;
- for(i = 0;i < fileopts.Count;i++)
+ for(i = 0;i < (*fileopts).Count;i++)
{
- DLT_REGISTER_CONTEXT(logfileContext[i], fileopts.ContextId[i],
- fileopts.Filename[i]);
+ DLT_REGISTER_CONTEXT(logfileContext[i], (*fileopts).ContextId[i],
+ (*fileopts).Filename[i]);
}
}
@@ -113,7 +113,7 @@ void logfile_thread(void *v_conf)
DLT_STRING("dlt-system-logfile, in thread."));
DltSystemConfiguration *conf = (DltSystemConfiguration *) v_conf;
- register_contexts(conf->LogFile);
+ register_contexts(&(conf->LogFile));
int logfile_delays[DLT_SYSTEM_LOG_FILE_MAX];
int i;
@@ -130,7 +130,7 @@ void logfile_thread(void *v_conf)
if(logfile_delays[i] <= 0)
{
- send_file(conf->LogFile, i);
+ send_file(&(conf->LogFile), i);
logfile_delays[i] = conf->LogFile.TimeDelay[i];
if(conf->LogFile.Mode[i] == SEND_MODE_ONCE)
conf->LogFile.Mode[i] = SEND_MODE_OFF;