-const char errlog_rcs[] = "$Id: errlog.c,v 1.116 2012/07/27 17:39:57 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.120 2014/06/02 06:22:20 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
* Purpose : Log errors to a designated destination in an elegant,
* printf-like fashion.
*
- * Copyright : Written by and Copyright (C) 2001-2010 the
+ * Copyright : Written by and Copyright (C) 2001-2014 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
#include "errlog.h"
#include "project.h"
#include "jcc.h"
+#ifdef FEATURE_EXTERNAL_FILTERS
+#include "jbsockets.h"
+#endif
const char errlog_h_rcs[] = ERRLOG_H_VERSION;
log_error(LOG_LEVEL_FATAL, "init_error_log(): can't open logfile: \'%s\'", logfname);
}
+#ifdef FEATURE_EXTERNAL_FILTERS
+ mark_socket_for_close_on_execute(3);
+#endif
+
/* set logging to be completely unbuffered */
setbuf(fp, NULL);
*********************************************************************/
static long get_thread_id(void)
{
- long this_thread = 1; /* was: pthread_t this_thread;*/
+ long this_thread;
#ifdef __OS2__
PTIB ptib;
ulrc = DosGetInfoBlocks(&ptib, NULL);
if (ulrc == 0)
this_thread = ptib -> tib_ptib2 -> tib2_ultid;
+#else
+ /* Forking instead of threading. */
+ this_thread = 1;
#endif /* def FEATURE_PTHREAD */
return this_thread;
}
+#define LOG_BUFFER_SIZE BUFFER_SIZE
/*********************************************************************
*
* Function : log_error
va_list ap;
char *outbuf = NULL;
static char *outbuf_save = NULL;
- char tempbuf[BUFFER_SIZE];
+ char tempbuf[LOG_BUFFER_SIZE];
size_t length = 0;
const char * src = fmt;
long thread_id;
* why else do we allocate instead of using
* an array?
*/
- size_t log_buffer_size = BUFFER_SIZE;
+ size_t log_buffer_size = LOG_BUFFER_SIZE;
#if defined(_WIN32) && !defined(_WIN_CONSOLE)
/*