X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=errlog.c;h=33c56bf8db8cbf2cfe2fc9f929b0dfa1e69bbda3;hb=abb070ca9783f681c36b115c4c9deb54f20143f2;hp=fe2ee38d0c287b174d993716c8176d3d23ffa7bf;hpb=4877176b79cd08a203f3c8375418f20bdd14573d;p=privoxy.git diff --git a/errlog.c b/errlog.c index fe2ee38d..33c56bf8 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.117 2012/12/09 12:28:14 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 $ @@ -6,7 +6,7 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.117 2012/12/09 12:28:14 fabiankeil * 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 @@ -75,6 +75,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.117 2012/12/09 12:28:14 fabiankeil #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; @@ -354,6 +357,10 @@ void init_error_log(const char *prog_name, const char *logfname) 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); @@ -402,7 +409,7 @@ void init_error_log(const char *prog_name, const char *logfname) *********************************************************************/ static long get_thread_id(void) { - long this_thread = 1; /* was: pthread_t this_thread;*/ + long this_thread; #ifdef __OS2__ PTIB ptib; @@ -427,6 +434,9 @@ static long get_thread_id(void) 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;