mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 01:46:32 -05:00
Use pathcmp for disk name comparisons to enforce case-insensitive uniqueness on Windows
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
23283e3abd
commit
a77f2a5a4c
6 changed files with 60 additions and 25 deletions
|
|
@ -375,27 +375,31 @@ static void msg(FILE* out, const char* format, ...)
|
|||
|
||||
void vlog_fatal(int err, const char* format, va_list ap, const char* post)
|
||||
{
|
||||
int log_failed = 0;
|
||||
|
||||
lock_msg();
|
||||
|
||||
if (stdlog) {
|
||||
if (is_hw(err))
|
||||
fprintf(stdlog, "msg:fatal_hardware: ");
|
||||
log_failed = fprintf(stdlog, "msg:fatal_hardware: ") < 0;
|
||||
else
|
||||
fprintf(stdlog, "msg:fatal: ");
|
||||
log_failed = fprintf(stdlog, "msg:fatal: ") < 0;
|
||||
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vfprintf(stdlog, format, ap_copy);
|
||||
if (vfprintf(stdlog, format, ap_copy) < 0)
|
||||
log_failed = 1;
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
fprintf(stdlog, "%s", post);
|
||||
if (post && fprintf(stdlog, "%s", post) < 0)
|
||||
log_failed = 1;
|
||||
|
||||
fflush(stdlog);
|
||||
if (fflush(stdlog) != 0)
|
||||
log_failed = 1;
|
||||
}
|
||||
|
||||
/* GUI consumers read tagged fatal messages from the log and must not receive a duplicate raw copy. */
|
||||
if (!stdlog || msg_fatal_stderr) {
|
||||
/* A failed tagged write must retain stderr as the only usable fatal diagnostic. */
|
||||
if (!stdlog || log_failed || msg_fatal_stderr) {
|
||||
va_list ap_copy2;
|
||||
va_copy(ap_copy2, ap);
|
||||
vmsg(stderr, format, ap_copy2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue