trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject git commit: TS-2624: Fix Build on older platforms
Date Wed, 07 May 2014 21:27:37 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 91c80ec58 -> 999ec640a


TS-2624: Fix Build on older platforms


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/999ec640
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/999ec640
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/999ec640

Branch: refs/heads/master
Commit: 999ec640ac0e7f2d4b73704cc11db374b817594a
Parents: 91c80ec
Author: Phil Sorber <sorber@apache.org>
Authored: Wed May 7 15:20:21 2014 -0600
Committer: Phil Sorber <sorber@apache.org>
Committed: Wed May 7 15:20:21 2014 -0600

----------------------------------------------------------------------
 iocore/eventsystem/UnixEventProcessor.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/999ec640/iocore/eventsystem/UnixEventProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 06fa411..725c4e6 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -101,8 +101,8 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
   REC_ReadConfigInteger(affinity, "proxy.config.exec_thread.affinity");
   hwloc_obj_t obj;
   hwloc_obj_type_t obj_type;
-  int obj_count = 0, cpu_mask_len = 0;
-  char *obj_name, *cpu_mask;
+  int obj_count = 0;
+  char *obj_name;
 
   switch(affinity) {
     case 4:           // assign threads to logical processing units
@@ -141,10 +141,14 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
     (void)tid;
 #if TS_USE_HWLOC
     obj = hwloc_get_obj_by_type(ink_get_topology(), obj_type, i % obj_count);
-    cpu_mask_len = hwloc_bitmap_snprintf(NULL, 0, obj->cpuset) + 1;
-    cpu_mask = (char *) alloca(cpu_mask_len);
+#if HWLOC_API_VERSION >= 0x00010100
+    int cpu_mask_len = hwloc_bitmap_snprintf(NULL, 0, obj->cpuset) + 1;
+    char *cpu_mask = (char *) alloca(cpu_mask_len);
     hwloc_bitmap_snprintf(cpu_mask, cpu_mask_len, obj->cpuset);
     Debug("iocore_thread","EThread: %d %s: %d CPU Mask: %s\n", i, obj_name, obj->logical_index,
cpu_mask);
+#else
+    Debug("iocore_thread","EThread: %d %s: %d\n", i, obj_name, obj->logical_index);
+#endif
     hwloc_set_thread_cpubind(ink_get_topology(), tid, obj->cpuset, HWLOC_CPUBIND_STRICT);
 #endif
   }


Mime
View raw message