[PATCH v2 01/25] Including <mntent.h> iff it exists.
Alejandro Colomar
alx.manpages at gmail.com
Mon Jun 20 07:10:44 UTC 2022
With NXT_HAVE_PIVOT_ROOT I had issues in MacOS. Headers should
normally be included unconditionally, except of course if they
don't exist.
---
auto/headers | 16 ++++++++++++++++
configure | 1 +
src/nxt_isolation.c | 2 +-
3 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 auto/headers
diff --git a/auto/headers b/auto/headers
new file mode 100644
index 00000000..8abf58eb
--- /dev/null
+++ b/auto/headers
@@ -0,0 +1,16 @@
+# Copyright (C) NGINX, Inc.
+
+# System headers.
+
+
+nxt_feature="<mntent.h>"
+nxt_feature_name=NXT_HAVE_MNTENT_H
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="#include <mntent.h>
+
+ int main(void) {
+ return 0;
+ }"
+. auto/feature
diff --git a/configure b/configure
index bc21e579..ad4b02b2 100755
--- a/configure
+++ b/configure
@@ -127,6 +127,7 @@ NXT_LIBRT=
. auto/sendfile
. auto/files
. auto/unix
+. auto/headers
. auto/os/conf
. auto/ssltls
diff --git a/src/nxt_isolation.c b/src/nxt_isolation.c
index e3cb1f22..c52adfab 100644
--- a/src/nxt_isolation.c
+++ b/src/nxt_isolation.c
@@ -7,7 +7,7 @@
#include <nxt_process.h>
#include <nxt_isolation.h>
-#if (NXT_HAVE_PIVOT_ROOT)
+#if (NXT_HAVE_MNTENT_H)
#include <mntent.h>
#endif
--
2.36.1
More information about the unit
mailing list