[or-cvs] r18450: {tor} Disable KQUEUE from inside Tor if the OSX version is prior t (in tor/trunk: . src/or)
nickm at seul.org
nickm at seul.org
Mon Feb 9 16:07:03 UTC 2009
Author: nickm
Date: 2009-02-09 11:07:02 -0500 (Mon, 09 Feb 2009)
New Revision: 18450
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/config.c
Log:
Disable KQUEUE from inside Tor if the OSX version is prior to 10.4.0
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2009-02-09 15:20:17 UTC (rev 18449)
+++ tor/trunk/ChangeLog 2009-02-09 16:07:02 UTC (rev 18450)
@@ -1,4 +1,11 @@
Changes in version 0.2.1.13-????? - 2009-0?-??
+ o Minor bugfixes:
+ - Automatically detect MacOSX versions earlier than 10.4.0, and
+ disable kqueue from inside Tor when running with these versions.
+ We previously did this from the startup script, but that was no
+ help to people who didn't use the startup script. Resolves
+ bug 863.
+
o Minor features:
- On Linux, use the prctl call to re-enable core dumps when the user
is option is set.
Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c 2009-02-09 15:20:17 UTC (rev 18449)
+++ tor/trunk/src/or/config.c 2009-02-09 16:07:02 UTC (rev 18450)
@@ -4735,6 +4735,18 @@
return (int)r;
}
+/* This is what passes for version detection on OSX. We set
+ * MACOSX_KQUEUE_IS_BROKEN to true iff we're on a version of OSX before
+ * 10.4.0 (aka 1040). */
+#ifdef __APPLE__
+#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+#define MACOSX_KQUEUE_IS_BROKEN \
+ (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1040)
+#else
+#define MACOSX_KQUEUE_IS_BROKEN 0
+#endif
+#endif
+
/**
* Initialize the libevent library.
*/
@@ -4747,7 +4759,8 @@
*/
suppress_libevent_log_msg("Function not implemented");
#ifdef __APPLE__
- if (decode_libevent_version(event_get_version(), NULL) < LE_11B) {
+ if (MACOSX_KQUEUE_IS_BROKEN ||
+ decode_libevent_version(event_get_version(), NULL) < LE_11B) {
setenv("EVENT_NOKQUEUE","1",1);
}
#endif
More information about the tor-commits
mailing list