functions on OpenBSD as well.
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.38 2006/07/18 14:48:46 david__schmidt Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.39 2006/08/03 02:46:41 david__schmidt Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
*
* Revisions :
* $Log: jbsockets.c,v $
+ * Revision 1.39 2006/08/03 02:46:41 david__schmidt
+ * Incorporate Fabian Keil's patch work:\rhttp://www.fabiankeil.de/sourcecode/privoxy/
+ *
* Revision 1.38 2006/07/18 14:48:46 david__schmidt
* Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
* with what was really the latest development (the v_3_0_branch branch)
#include "project.h"
-#ifdef OSX_DARWIN
-#include <pthread.h>
+#if defined(OSX_DARWIN) || defined(__OpenBSD__)
#include "jcc.h"
/* jcc.h is for mutex semaphores only */
-#endif /* def OSX_DARWIN */
+#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
#include "jbsockets.h"
#include "filters.h"
{
host = NULL;
}
-#elif defined(OSX_DARWIN)
+#elif defined(OSX_DARWIN) || defined(__OpenBSD__)
pthread_mutex_lock(&gethostbyaddr_mutex);
host = gethostbyaddr((const char *)&server.sin_addr,
sizeof(server.sin_addr), AF_INET);
{
hostp = NULL;
}
-#elif OSX_DARWIN
+#elif defined(OSX_DARWIN) || defined(__OpenBSD__)
pthread_mutex_lock(&gethostbyname_mutex);
while ( NULL == (hostp = gethostbyname(host))
&& (h_errno == TRY_AGAIN) && (dns_retries++ < 10) )
-const char jcc_rcs[] = "$Id: jcc.c,v 1.97 2006/08/18 15:23:17 david__schmidt Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.98 2006/08/24 11:01:34 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.98 2006/08/24 11:01:34 fabiankeil
+ * --user fix. Only use the user as group if no group is specified.
+ * Solves BR 1492612. Thanks to Spinor S. and David Laight.
+ *
* Revision 1.97 2006/08/18 15:23:17 david__schmidt
* Windows service (re-)integration
*
#define sleep(N) DosSleep(((N) * 100))
#endif
+#if defined(OSX_DARWIN) || defined(__OpenBSD__)
#ifdef OSX_DARWIN
/*
* Hit OSX over the head with a hammer. Protect all *_r functions.
*/
pthread_mutex_t gmtime_mutex;
pthread_mutex_t localtime_mutex;
+#endif /* def OSX_DARWIN */
+/*
+ * Protect only the resolve functions for OpenBSD.
+ */
pthread_mutex_t gethostbyaddr_mutex;
pthread_mutex_t gethostbyname_mutex;
-#endif /* def OSX_DARWIN */
+#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
#ifdef FEATURE_PTHREAD
pthread_mutex_t log_mutex;
InitWin32();
#endif
-#ifdef OSX_DARWIN
+#if defined(OSX_DARWIN) || defined(__OpenBSD__)
/*
* Prepare global mutex semaphores
*/
+#ifdef OSX_DARWIN
pthread_mutex_init(&gmtime_mutex,0);
pthread_mutex_init(&localtime_mutex,0);
+#endif /* def OSX_DARWIN */
pthread_mutex_init(&gethostbyaddr_mutex,0);
pthread_mutex_init(&gethostbyname_mutex,0);
-#endif /* def OSX_DARWIN */
+#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
#ifdef FEATURE_PTHREAD
pthread_mutex_init(&log_mutex,0);
#ifndef JCC_H_INCLUDED
#define JCC_H_INCLUDED
-#define JCC_H_VERSION "$Id: jcc.h,v 1.14 2006/07/18 14:48:46 david__schmidt Exp $"
+#define JCC_H_VERSION "$Id: jcc.h,v 1.15 2006/09/02 10:24:30 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
*
* Revisions :
* $Log: jcc.h,v $
+ * Revision 1.15 2006/09/02 10:24:30 fabiankeil
+ * Include pthread.h for OpenBSD to make Privoxy build again.
+ *
+ * Tested shortly on OpenBSD 3.9 without problems, but the OpenBSD
+ * port has additional patches to use the mutexes OSX_DARWIN needs,
+ * and it should be investigated if they are still required for
+ * reliable operation.
+ *
* Revision 1.14 2006/07/18 14:48:46 david__schmidt
* Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
* with what was really the latest development (the v_3_0_branch branch)
#if defined(OSX_DARWIN) || defined(__OpenBSD__)
#include <pthread.h>
-#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
-
#ifdef OSX_DARWIN
extern pthread_mutex_t gmtime_mutex;
extern pthread_mutex_t localtime_mutex;
+#endif /* def OSX_DARWIN */
extern pthread_mutex_t gethostbyaddr_mutex;
extern pthread_mutex_t gethostbyname_mutex;
-#endif /* def OSX_DARWIN */
+#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
#ifdef FEATURE_PTHREAD
extern pthread_mutex_t log_mutex;