Clean up summary slightly better on exit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/cgminer.c b/cgminer.c
index 679a2c8..74012f6 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2735,6 +2735,7 @@ static bool get_upstream_work(struct work *work, CURL *curl)
static void disable_curses(void)
{
if (curses_active_locked()) {
+ use_curses = false;
curses_active = false;
leaveok(logwin, false);
leaveok(statuswin, false);
@@ -6454,12 +6455,15 @@ void print_summary(void)
log_print_status(cgpu);
}
- if (opt_shares)
+ if (opt_shares) {
applog(LOG_WARNING, "Mined %d accepted shares of %d requested\n", total_accepted, opt_shares);
- fflush(stdout);
+ if (opt_shares > total_accepted)
+ applog(LOG_WARNING, "WARNING - Mined only %d shares of %d requested.", total_accepted, opt_shares);
+ }
+ applog(LOG_WARNING, "");
+
fflush(stderr);
- if (opt_shares > total_accepted)
- applog(LOG_WARNING, "WARNING - Mined only %d shares of %d requested.", total_accepted, opt_shares);
+ fflush(stdout);
}
static void clean_up(void)
@@ -6483,17 +6487,10 @@ static void clean_up(void)
void quit(int status, const char *format, ...)
{
- va_list ap;
-
clean_up();
- if (format) {
- va_start(ap, format);
- vfprintf(stderr, format, ap);
- va_end(ap);
- }
- fprintf(stderr, "\n");
- fflush(stderr);
+ if (format)
+ log_error(format);
#if defined(unix)
if (forkpid > 0) {