|
@@ -87,7 +87,7 @@ static bool opt_benchmark;
|
|
|
static bool have_longpoll;
|
|
static bool have_longpoll;
|
|
|
static bool want_per_device_stats;
|
|
static bool want_per_device_stats;
|
|
|
bool use_syslog;
|
|
bool use_syslog;
|
|
|
-static bool opt_quiet;
|
|
|
|
|
|
|
+bool opt_quiet;
|
|
|
static bool opt_realquiet;
|
|
static bool opt_realquiet;
|
|
|
bool opt_loginput;
|
|
bool opt_loginput;
|
|
|
const int opt_cutofftemp = 95;
|
|
const int opt_cutofftemp = 95;
|
|
@@ -167,9 +167,7 @@ static int total_threads;
|
|
|
static pthread_mutex_t hash_lock;
|
|
static pthread_mutex_t hash_lock;
|
|
|
static pthread_mutex_t qd_lock;
|
|
static pthread_mutex_t qd_lock;
|
|
|
static pthread_mutex_t *stgd_lock;
|
|
static pthread_mutex_t *stgd_lock;
|
|
|
-#ifdef HAVE_CURSES
|
|
|
|
|
-static pthread_mutex_t curses_lock;
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+pthread_mutex_t console_lock;
|
|
|
static pthread_mutex_t ch_lock;
|
|
static pthread_mutex_t ch_lock;
|
|
|
static pthread_rwlock_t blk_lock;
|
|
static pthread_rwlock_t blk_lock;
|
|
|
|
|
|
|
@@ -205,10 +203,11 @@ enum pool_strategy pool_strategy = POOL_FAILOVER;
|
|
|
int opt_rotate_period;
|
|
int opt_rotate_period;
|
|
|
static int total_urls, total_users, total_passes, total_userpasses;
|
|
static int total_urls, total_users, total_passes, total_userpasses;
|
|
|
|
|
|
|
|
|
|
+static
|
|
|
#ifndef HAVE_CURSES
|
|
#ifndef HAVE_CURSES
|
|
|
const
|
|
const
|
|
|
#endif
|
|
#endif
|
|
|
-static bool curses_active;
|
|
|
|
|
|
|
+bool curses_active;
|
|
|
|
|
|
|
|
static char current_block[37];
|
|
static char current_block[37];
|
|
|
static char *current_hash;
|
|
static char *current_hash;
|
|
@@ -1339,8 +1338,10 @@ double total_secs = 0.1;
|
|
|
static char statusline[256];
|
|
static char statusline[256];
|
|
|
/* logstart is where the log window should start */
|
|
/* logstart is where the log window should start */
|
|
|
static int devcursor, logstart, logcursor;
|
|
static int devcursor, logstart, logcursor;
|
|
|
|
|
+#ifdef HAVE_CURSES
|
|
|
/* statusy is where the status window goes up to in cases where it won't fit at startup */
|
|
/* statusy is where the status window goes up to in cases where it won't fit at startup */
|
|
|
static int statusy;
|
|
static int statusy;
|
|
|
|
|
+#endif
|
|
|
#ifdef HAVE_OPENCL
|
|
#ifdef HAVE_OPENCL
|
|
|
struct cgpu_info gpus[MAX_GPUDEVICES]; /* Maximum number apparently possible */
|
|
struct cgpu_info gpus[MAX_GPUDEVICES]; /* Maximum number apparently possible */
|
|
|
#endif
|
|
#endif
|
|
@@ -1349,12 +1350,12 @@ struct cgpu_info *cpus;
|
|
|
#ifdef HAVE_CURSES
|
|
#ifdef HAVE_CURSES
|
|
|
static inline void unlock_curses(void)
|
|
static inline void unlock_curses(void)
|
|
|
{
|
|
{
|
|
|
- mutex_unlock(&curses_lock);
|
|
|
|
|
|
|
+ mutex_unlock(&console_lock);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void lock_curses(void)
|
|
static inline void lock_curses(void)
|
|
|
{
|
|
{
|
|
|
- mutex_lock(&curses_lock);
|
|
|
|
|
|
|
+ mutex_lock(&console_lock);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static bool curses_active_locked(void)
|
|
static bool curses_active_locked(void)
|
|
@@ -1588,13 +1589,10 @@ void wlogprint(const char *f, ...)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_CURSES
|
|
#ifdef HAVE_CURSES
|
|
|
-void log_curses(int prio, const char *f, va_list ap)
|
|
|
|
|
|
|
+bool log_curses_only(int prio, const char *f, va_list ap)
|
|
|
{
|
|
{
|
|
|
bool high_prio;
|
|
bool high_prio;
|
|
|
|
|
|
|
|
- if (opt_quiet && prio != LOG_ERR)
|
|
|
|
|
- return;
|
|
|
|
|
-
|
|
|
|
|
high_prio = (prio == LOG_WARNING || prio == LOG_ERR);
|
|
high_prio = (prio == LOG_WARNING || prio == LOG_ERR);
|
|
|
|
|
|
|
|
if (curses_active_locked()) {
|
|
if (curses_active_locked()) {
|
|
@@ -1606,8 +1604,9 @@ void log_curses(int prio, const char *f, va_list ap)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
unlock_curses();
|
|
unlock_curses();
|
|
|
- } else
|
|
|
|
|
- vprintf(f, ap);
|
|
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void clear_logwin(void)
|
|
void clear_logwin(void)
|
|
@@ -5126,9 +5125,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
|
|
mutex_init(&hash_lock);
|
|
mutex_init(&hash_lock);
|
|
|
mutex_init(&qd_lock);
|
|
mutex_init(&qd_lock);
|
|
|
-#ifdef HAVE_CURSES
|
|
|
|
|
- mutex_init(&curses_lock);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ mutex_init(&console_lock);
|
|
|
mutex_init(&control_lock);
|
|
mutex_init(&control_lock);
|
|
|
mutex_init(&sharelog_lock);
|
|
mutex_init(&sharelog_lock);
|
|
|
mutex_init(&ch_lock);
|
|
mutex_init(&ch_lock);
|