1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 23:08:07 +00:00

applog - force type checking

This commit is contained in:
Kano 2013-05-02 22:50:25 +10:00
parent ed65653ca6
commit 8f08a327ca
3 changed files with 16 additions and 5 deletions

View File

@ -6487,10 +6487,14 @@ static void clean_up(void)
void quit(int status, const char *format, ...) void quit(int status, const char *format, ...)
{ {
clean_up(); if (format) {
va_list ap;
va_start(ap, format);
vapplog(LOG_ERR, format, ap);
va_end(ap);
}
if (format) clean_up();
log_error(format);
#if defined(unix) #if defined(unix)
if (forkpid > 0) { if (forkpid > 0) {

View File

@ -53,7 +53,7 @@ void vapplog(int prio, const char *fmt, va_list ap)
log_generic(prio, fmt, ap); log_generic(prio, fmt, ap);
} }
void applog(int prio, const char *fmt, ...) void _applog(int prio, const char *fmt, ...)
{ {
va_list ap; va_list ap;

View File

@ -28,7 +28,14 @@ extern int opt_log_level;
/* low-level logging functions with priority parameter */ /* low-level logging functions with priority parameter */
extern void vapplog(int prio, const char *fmt, va_list ap); extern void vapplog(int prio, const char *fmt, va_list ap);
extern void applog(int prio, const char *fmt, ...); extern void _applog(int prio, const char *fmt, ...);
#define applog(prio, fmt, ...) do { \
char *tmp42; \
if (0) \
sprintf(tmp42, fmt, ##__VA_ARGS__); \
else \
_applog(prio, fmt, ##__VA_ARGS__); \
} while (0)
/* high-level logging functions with implicit priority */ /* high-level logging functions with implicit priority */
extern void log_error(const char *fmt, ...); extern void log_error(const char *fmt, ...);