mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Avoid calling close(-1) on incomplete stream
Some checks failed
Some checks failed
This commit is contained in:
parent
212a0ce6d1
commit
bfaa60890b
1 changed files with 7 additions and 4 deletions
|
|
@ -183,10 +183,13 @@ int sclose(STREAM* s)
|
|||
}
|
||||
|
||||
for (i = 0; i < s->handle_size; ++i) {
|
||||
if (close(s->handle[i].f) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
fail = 1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
/* if open failed, there is nothing to close */
|
||||
if (s->handle[i].f != -1) {
|
||||
if (close(s->handle[i].f) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
fail = 1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue