mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 11:26:48 -05: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) {
|
for (i = 0; i < s->handle_size; ++i) {
|
||||||
if (close(s->handle[i].f) != 0) {
|
/* if open failed, there is nothing to close */
|
||||||
/* LCOV_EXCL_START */
|
if (s->handle[i].f != -1) {
|
||||||
fail = 1;
|
if (close(s->handle[i].f) != 0) {
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_START */
|
||||||
|
fail = 1;
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue