summaryrefslogtreecommitdiff
path: root/src/system/dlt-system-processes.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-processes.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-processes.c')
-rw-r--r--src/system/dlt-system-processes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/system/dlt-system-processes.c b/src/system/dlt-system-processes.c
index ee37bfc..495c784 100644
--- a/src/system/dlt-system-processes.c
+++ b/src/system/dlt-system-processes.c
@@ -63,7 +63,7 @@ extern DltSystemThreads threads;
DLT_IMPORT_CONTEXT(dltsystem)
DLT_DECLARE_CONTEXT(procContext)
-void send_process(LogProcessOptions popts, int n)
+void send_process(LogProcessOptions const *popts, int n)
{
DLT_LOG(dltsystem, DLT_LOG_DEBUG,
DLT_STRING("dlt-system-processes, send process info."));
@@ -90,11 +90,11 @@ void send_process(LogProcessOptions popts, int n)
bytes = fread(buffer, 1, sizeof(buffer)-1, pFile);
fclose(pFile);
}
- if((strcmp(popts.Name[n], "*")==0) ||
- (strcmp(buffer, popts.Name[n])==0))
+ if((strcmp((*popts).Name[n], "*")==0) ||
+ (strcmp(buffer, (*popts).Name[n])==0))
{
found = 1;
- sprintf(filename, "/proc/%s/%s", dp->d_name,popts.Filename[n]);
+ sprintf(filename, "/proc/%s/%s", dp->d_name,(*popts).Filename[n]);
pFile = fopen(filename, "r");
if(pFile != NULL)
{
@@ -104,10 +104,10 @@ void send_process(LogProcessOptions popts, int n)
if(bytes>0)
{
buffer[bytes] = 0;
- DLT_LOG(procContext, DLT_LOG_INFO, DLT_INT(atoi(dp->d_name)), DLT_STRING(popts.Filename[n]), DLT_STRING(buffer));
+ DLT_LOG(procContext, DLT_LOG_INFO, DLT_INT(atoi(dp->d_name)), DLT_STRING((*popts).Filename[n]), DLT_STRING(buffer));
}
}
- if(strcmp(popts.Name[n], "*") !=0)
+ if(strcmp((*popts).Name[n], "*") !=0)
break;
}
}
@@ -121,7 +121,7 @@ void send_process(LogProcessOptions popts, int n)
}
if(!found) {
- DLT_LOG(procContext, DLT_LOG_INFO, DLT_STRING("Process"), DLT_STRING(popts.Name[n]),DLT_STRING("not running!"));
+ DLT_LOG(procContext, DLT_LOG_INFO, DLT_STRING("Process"), DLT_STRING((*popts).Name[n]),DLT_STRING("not running!"));
}
}
@@ -148,7 +148,7 @@ void logprocess_thread(void *v_conf)
if(process_delays[i] <= 0)
{
- send_process(conf->LogProcesses, i);
+ send_process(&(conf->LogProcesses), i);
process_delays[i] = conf->LogProcesses.TimeDelay[i];
if(conf->LogProcesses.Mode[i] == SEND_MODE_ONCE)
conf->LogProcesses.Mode[i] = SEND_MODE_OFF;