Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
powerlink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
powerlink
Commits
313abec5
Commit
313abec5
authored
Aug 03, 2017
by
Joerg Zelenka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Solve ignoring return value of fread warning
Change-Id: I06b7326cac7cb56ea5f153390ec166dcd502be04
parent
d4c88ace
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
obdcdc.c
stack/src/user/obd/obdcdc.c
+5
-2
obdconf-fileio.c
stack/src/user/obd/obdconf-fileio.c
+7
-6
No files found.
stack/src/user/obd/obdcdc.c
View file @
313abec5
...
...
@@ -438,6 +438,9 @@ The function loads the next buffer from the CDC
static
tOplkError
loadNextBuffer
(
tObdCdcInfo
*
pCdcInfo_p
,
size_t
bufferSize_p
)
{
tOplkError
ret
=
kErrorOk
;
#if (OBDCDC_DISABLE_FILE_SUPPORT == FALSE)
size_t
count
;
#endif
switch
(
pCdcInfo_p
->
type
)
{
...
...
@@ -464,8 +467,8 @@ static tOplkError loadNextBuffer(tObdCdcInfo* pCdcInfo_p, size_t bufferSize_p)
pCdcInfo_p
->
bufferSize
=
bufferSize_p
;
}
fread
(
pCdcInfo_p
->
pCurBuffer
,
bufferSize_p
,
1
,
pCdcInfo_p
->
handle
.
pFdCdcFile
);
if
(
ferror
(
pCdcInfo_p
->
handle
.
pFdCdcFile
)
||
feof
(
pCdcInfo_p
->
handle
.
pFdCdcFile
))
count
=
fread
(
pCdcInfo_p
->
pCurBuffer
,
bufferSize_p
,
1
,
pCdcInfo_p
->
handle
.
pFdCdcFile
);
if
(
ferror
(
pCdcInfo_p
->
handle
.
pFdCdcFile
)
||
feof
(
pCdcInfo_p
->
handle
.
pFdCdcFile
)
||
(
count
==
0
)
)
{
ret
=
eventu_postError
(
kEventSourceObdu
,
kErrorObdInvalidDcf
,
0
,
NULL
);
if
(
ret
!=
kErrorOk
)
...
...
stack/src/user/obd/obdconf-fileio.c
View file @
313abec5
...
...
@@ -555,6 +555,7 @@ tOplkError obdconf_loadPart(tObdPart odPart_p,
{
tOplkError
ret
=
kErrorObdStoreHwError
;
tObdConfInstance
*
pInstEntry
=
&
aObdConfInstance_l
[
0
];
size_t
count
;
if
(
odPart_p
!=
pInstEntry
->
curOdPart
)
{
...
...
@@ -570,8 +571,8 @@ tOplkError obdconf_loadPart(tObdPart odPart_p,
}
// Read OD data from current file position
fread
(
pData_p
,
size_p
,
1
,
pInstEntry
->
pFdBkupArchiveFile
);
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
))
count
=
fread
(
pData_p
,
size_p
,
1
,
pInstEntry
->
pFdBkupArchiveFile
);
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
)
||
(
count
==
0
)
)
{
ret
=
kErrorObdStoreHwError
;
goto
Exit
;
...
...
@@ -722,18 +723,18 @@ tOplkError obdconf_getPartArchiveState(tObdPart odPart_p, UINT32 odPartSignature
fseek
(
pInstEntry
->
pFdBkupArchiveFile
,
0
,
SEEK_SET
);
// Read target signature and calculate the CRC for it
fread
(
&
readTargetSign
,
sizeof
(
readTargetSign
),
1
,
pInstEntry
->
pFdBkupArchiveFile
);
count
=
fread
(
&
readTargetSign
,
sizeof
(
readTargetSign
),
1
,
pInstEntry
->
pFdBkupArchiveFile
);
dataCrc
=
obdconf_calculateCrc16
(
0
,
&
readTargetSign
,
sizeof
(
readTargetSign
));
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
)
||
feof
(
pInstEntry
->
pFdBkupArchiveFile
))
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
)
||
feof
(
pInstEntry
->
pFdBkupArchiveFile
)
||
(
count
==
0
)
)
{
ret
=
kErrorObdStoreHwError
;
goto
Exit
;
}
// Read OD signature and calculate the CRC for it
fread
(
&
readOdSign
,
sizeof
(
readOdSign
),
1
,
pInstEntry
->
pFdBkupArchiveFile
);
count
=
fread
(
&
readOdSign
,
sizeof
(
readOdSign
),
1
,
pInstEntry
->
pFdBkupArchiveFile
);
dataCrc
=
obdconf_calculateCrc16
(
dataCrc
,
&
readOdSign
,
sizeof
(
readOdSign
));
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
)
||
feof
(
pInstEntry
->
pFdBkupArchiveFile
))
if
(
ferror
(
pInstEntry
->
pFdBkupArchiveFile
)
||
feof
(
pInstEntry
->
pFdBkupArchiveFile
)
||
(
count
==
0
)
)
{
ret
=
kErrorObdStoreHwError
;
goto
Exit
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment