mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Remove a clang warning about file var being potentially 0
This commit is contained in:
parent
618af56a13
commit
0a46ac605a
1 changed files with 11 additions and 9 deletions
|
|
@ -79,15 +79,17 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
/* if the file is closed or different than the current one */
|
||||
if (handle[j].file == 0 || handle[j].file != block_file_get(block)) {
|
||||
struct snapraid_file* file = handle[j].file;
|
||||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_tag("error:%u:%s:%s: Close error. %s\n", i, disk->name, esc(file->sub), strerror(errno));
|
||||
log_fatal("DANGER! Unexpected close error in a data disk, it isn't possible to dry.\n");
|
||||
log_fatal("Stopping at block %u\n", i);
|
||||
++error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
if (file != 0) {
|
||||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_tag("error:%u:%s:%s: Close error. %s\n", i, disk->name, esc(file->sub), strerror(errno));
|
||||
log_fatal("DANGER! Unexpected close error in a data disk, it isn't possible to dry.\n");
|
||||
log_fatal("Stopping at block %u\n", i);
|
||||
++error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
/* open the file only for reading */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue