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

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

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

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


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

commit 78137564d4e30720a579c9495db8de6c46ebf9ae
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)
---
 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 6bef79d..922b474 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 ad47f33..c8babcf 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 <cstring>
 #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>