Skip to content

Commit 468c219

Browse files
committed
build: fix some things
1 parent f32029b commit 468c219

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core-modules/core-modules.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#include "platform.hpp"
2+
13
#include <dlfcn.h>
2-
#include <mntent.h>
34
#include <unistd.h>
45

56
#include <algorithm>
@@ -19,6 +20,10 @@
1920
# include "linux/utils/packages.hpp"
2021
#endif
2122

23+
#if !CF_MACOS
24+
# include <mntent.h>
25+
#endif
26+
2227
using unused = const callbackInfo_t*;
2328

2429
std::string amount(const double amount, const moduleArgs_t* moduleArgs)
@@ -179,10 +184,12 @@ void core_plugins_start(const Config& config)
179184
is_tty = true;
180185
term_name = ttyname(STDIN_FILENO);
181186
}
187+
#if !CF_MACOS
182188
os_release = fopen("/etc/os-release", "r");
183189
cpuinfo = fopen("/proc/cpuinfo", "r");
184190
meminfo = fopen("/proc/meminfo", "r");
185191
mountsFile = setmntent("/proc/mounts", "r");
192+
#endif
186193

187194
#if CF_ANDROID
188195
is_tty = true;

0 commit comments

Comments
 (0)