1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-30 00:14:26 +00:00

va list needs to be copied as it's invalidated either way.

This commit is contained in:
Con Kolivas 2011-07-11 22:07:17 +10:00
parent 73a864c51c
commit 231cd4fd9e

7
util.c
View File

@ -90,12 +90,15 @@ void vapplog(int prio, const char *fmt, va_list ap)
tm.tm_min,
tm.tm_sec,
fmt);
log_curses(f, ap);
/* Only output to stderr if it's not going to the screen as well */
if (opt_log_output && !isatty(fileno((FILE *)stderr))) {
vfprintf(stderr, f, ap); /* atomic write to stderr */
va_list apc;
va_copy(apc, ap);
vfprintf(stderr, f, apc); /* atomic write to stderr */
fflush(stderr);
}
log_curses(f, ap);
}
}