X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=errlog.c;h=e1d99259a745b89dd65a8589dc98c0ebf369f225;hp=afeac437d66d18883729d35f3a0d31dae8c599d9;hb=9540faa0465d9a358b8ad5451dbb93b20e819556;hpb=230a3595587cb6581819a98be81ddcaf8f83ab3e diff --git a/errlog.c b/errlog.c index afeac437..e1d99259 100644 --- a/errlog.c +++ b/errlog.c @@ -92,19 +92,19 @@ static char *w32_socket_strerr(int errcode, char *tmp_buf); #endif #ifdef MUTEX_LOCKS_AVAILABLE -static inline void lock_logfile(void) +static void lock_logfile(void) { privoxy_mutex_lock(&log_mutex); } -static inline void unlock_logfile(void) +static void unlock_logfile(void) { privoxy_mutex_unlock(&log_mutex); } -static inline void lock_loginit(void) +static void lock_loginit(void) { privoxy_mutex_lock(&log_init_mutex); } -static inline void unlock_loginit(void) +static void unlock_loginit(void) { privoxy_mutex_unlock(&log_init_mutex); } @@ -114,10 +114,10 @@ static inline void unlock_loginit(void) * The locking/unlocking functions below should be * fleshed out for non-pthread implementations. */ -static inline void lock_logfile() {} -static inline void unlock_logfile() {} -static inline void lock_loginit() {} -static inline void unlock_loginit() {} +static void lock_logfile() {} +static void unlock_logfile() {} +static void lock_loginit() {} +static void unlock_loginit() {} #endif /********************************************************************* @@ -444,7 +444,7 @@ static long get_thread_id(void) * Returns : Number of written characters or 0 for error. * *********************************************************************/ -static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) +static size_t get_log_timestamp(char *buffer, size_t buffer_size) { size_t length; time_t now; @@ -498,7 +498,7 @@ static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) * Returns : Number of written characters or 0 for error. * *********************************************************************/ -static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) +static size_t get_clf_timestamp(char *buffer, size_t buffer_size) { /* * Complex because not all OSs have tm_gmtoff or @@ -563,7 +563,7 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) * Returns : Log level string. * *********************************************************************/ -static inline const char *get_log_level_string(int loglevel) +static const char *get_log_level_string(int loglevel) { char *log_level_string = NULL; @@ -583,7 +583,7 @@ static inline const char *get_log_level_string(int loglevel) case LOG_LEVEL_CONNECT: log_level_string = "Connect"; break; - case LOG_LEVEL_TAGGING: + case LOG_LEVEL_TAGGING: log_level_string = "Tagging"; break; case LOG_LEVEL_WRITING: @@ -683,6 +683,10 @@ void log_error(int loglevel, const char *fmt, ...) #ifdef FUZZ if (debug == LOG_LEVEL_STFU) { + if (loglevel == LOG_LEVEL_FATAL) + { + exit(1); + } return; } #endif @@ -815,7 +819,10 @@ void log_error(int loglevel, const char *fmt, ...) int ret = snprintf(outbuf + length, log_buffer_size - length - 2, "\\x%.2x", (unsigned char)*sval); assert(ret == 4); - length += 4; + if (ret == 4) + { + length += 4; + } } sval++; }