diff options
author | Lassi Marttala <lassi.lm.marttala@partner.bmw.de> | 2012-05-30 11:56:22 +0200 |
---|---|---|
committer | Christian Muck <christian.muck@bmw.de> | 2012-06-13 23:52:40 +0200 |
commit | bea4e475456745f444e2451415366d0e283f835c (patch) | |
tree | b9a84d2fbf19784f1b33f5c59f5d664b3d8b8dc4 /src/system/dlt-system-logfile.c | |
parent | f8f80a07afd45d60c2975bfd7e4b859fb8c10a96 (diff) | |
download | DLT-daemon-bea4e475456745f444e2451415366d0e283f835c.tar.gz |
dlt-system: Logging of error conditions. Assert memory allocations.
dlt-system: logfile module would sometimes deadlock in the end of a
file because of feof() reset in the end of the file.
Signed-off-by: Christian Muck <christian.muck@bmw.de>
Diffstat (limited to 'src/system/dlt-system-logfile.c')
-rw-r--r-- | src/system/dlt-system-logfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/system/dlt-system-logfile.c b/src/system/dlt-system-logfile.c index 8872d20..63c81b5 100644 --- a/src/system/dlt-system-logfile.c +++ b/src/system/dlt-system-logfile.c @@ -79,6 +79,7 @@ void send_file(LogFileOptions fileopt, int n) if(feof(pFile)) { DLT_LOG(context, DLT_LOG_INFO, DLT_INT(seq*-1), DLT_STRING(buffer)); + break; } else { DLT_LOG(context, DLT_LOG_INFO, DLT_INT(seq++), DLT_STRING(buffer)); @@ -86,6 +87,12 @@ void send_file(LogFileOptions fileopt, int n) } fclose(pFile); } + else + { + DLT_LOG(dltsystem, DLT_LOG_ERROR, + DLT_STRING("dlt-system-logfile, failed to open file."), + DLT_STRING(fileopt.Filename[n])); + } } void register_contexts(LogFileOptions fileopts) |