1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

coverity: fix regresions from 16e9b32c2f

16e9b32c2f incorrectly moved
free of opened descriptor out of if{} - resulted of
closing random file handle.
This commit is contained in:
Zdenek Kabelac 2015-07-08 15:35:37 +02:00
parent 6b48233f25
commit fd37eeddd6

View File

@ -101,10 +101,11 @@ void init_log_file(const char *log_file, int append)
append = 1; /* force */
}
}
if (st && fclose(st))
log_sys_debug("fclose", statfile);
}
if (st && fclose(st))
log_sys_debug("fclose", statfile);
no_epoch:
if (!(_log_file = fopen(log_file, append ? "a" : "w"))) {
log_sys_error("fopen", log_file);