diff options
author | Simon Brandner <simon.brandner@partner.bmw.de> | 2013-01-28 12:14:06 +0100 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2013-07-19 16:54:38 +0200 |
commit | e2943ff4cf2d7d2da4000e2ca35663a7c83675d7 (patch) | |
tree | 1a710a70a5190dacdb26c02da6cb570271f5d506 /src/shared/dlt_common.c | |
parent | 733a1111254882aec6ebc9c90bb690aaee3f2773 (diff) | |
download | DLT-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/shared/dlt_common.c')
-rwxr-xr-x | src/shared/dlt_common.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 7e9d852..fbc1934 100755 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -1484,7 +1484,8 @@ int dlt_file_read_header_raw(DltFile *file,int resync,int verbose) else { /* go back to last file position */ - fseek(file->handle,file->file_position,SEEK_SET); + if (fseek(file->handle,file->file_position,SEEK_SET) < 0) + return -1; } } @@ -1711,7 +1712,12 @@ int dlt_file_read(DltFile *file,int verbose) } /* set to end of last succesful read message, because of conflicting calls to dlt_file_read and dlt_file_message */ - fseek(file->handle,file->file_position,SEEK_SET); + if ( fseek(file->handle,file->file_position,SEEK_SET) < 0 ) + { + sprintf(str,"Seek failed to file_position %ld \n",file->file_position); + dlt_log(LOG_ERR, str); + return -1; + } /* get file position at start of DLT message */ if (verbose) @@ -1823,8 +1829,9 @@ int dlt_file_read_raw(DltFile *file,int resync, int verbose) file->index = ptr; } - /* set to end of last succesful read message, because of conflicting calls to dlt_file_read and dlt_file_message */ - fseek(file->handle,file->file_position,SEEK_SET); + /* set to end of last successful read message, because of conflicting calls to dlt_file_read and dlt_file_message */ + if (fseek(file->handle,file->file_position,SEEK_SET) < 0) + return -1; /* get file position at start of DLT message */ if (verbose) |