You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2019/11/07 21:29:13 UTC

[trafficserver] branch 8.0.x updated: Remove including sys/sysctl.h for Linux

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.0.x by this push:
     new 4be6906  Remove including sys/sysctl.h for Linux
4be6906 is described below

commit 4be6906afcf6e3abd3d03fbd6623d5c32ffc4aab
Author: Bryan Call <bc...@apache.org>
AuthorDate: Tue Nov 5 17:36:55 2019 -0800

    Remove including sys/sysctl.h for Linux
    
    (cherry picked from commit 3ea8301d1572073072063233b6974244d1827e81)
    
     Conflicts:
    	src/tscore/ink_hrtime.cc
---
 include/tscore/ink_platform.h | 2 ++
 src/tscore/ink_hrtime.cc      | 2 ++
 tests/include/catch.hpp       | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/include/tscore/ink_platform.h b/include/tscore/ink_platform.h
index 321bfdf..32212a9 100644
--- a/include/tscore/ink_platform.h
+++ b/include/tscore/ink_platform.h
@@ -157,9 +157,11 @@ typedef unsigned int in_addr_t;
 #include <sys/sysinfo.h>
 #endif
 
+#if defined(darwin) || defined(freebsd)
 #ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
+#endif
 
 #ifdef HAVE_SYS_SYSTEMINFO_H
 #include <sys/systeminfo.h>
diff --git a/src/tscore/ink_hrtime.cc b/src/tscore/ink_hrtime.cc
index 3a328c2..a535065 100644
--- a/src/tscore/ink_hrtime.cc
+++ b/src/tscore/ink_hrtime.cc
@@ -35,8 +35,10 @@
 #if defined(freebsd)
 #include <sys/types.h>
 #include <sys/param.h>
+#ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
+#endif
 #include <string.h>
 #include <sys/time.h>
 
diff --git a/tests/include/catch.hpp b/tests/include/catch.hpp
index ecd8907..d7bb037 100644
--- a/tests/include/catch.hpp
+++ b/tests/include/catch.hpp
@@ -7093,7 +7093,11 @@ namespace Catch {
 #  include <stdbool.h>
 #  include <sys/types.h>
 #  include <unistd.h>
+#if defined(darwin) || defined(freebsd)
+#ifdef HAVE_SYS_SYSCTL_H
 #  include <sys/sysctl.h>
+#endif
+#endif
 #  include <cstddef>
 #  include <ostream>