Including <mntent.h> iff it exists.

With NXT_HAVE_PIVOT_ROOT, we had issues in MacOS.  Headers should
normally be included unconditionally, except of course if they
don't exist.

This fixes part of the #737 issue on GitHub.
This commit is contained in:
Alejandro Colomar
2022-06-19 12:48:01 +02:00
parent 698680d894
commit 2c0888f69c
2 changed files with 14 additions and 1 deletions

View File

@@ -73,6 +73,19 @@ nxt_feature_test="#include <sys/syscall.h>
. auto/feature . auto/feature
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
nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)" nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)"
nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS0 nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS0
nxt_feature_run=no nxt_feature_run=no

View File

@@ -7,7 +7,7 @@
#include <nxt_process.h> #include <nxt_process.h>
#include <nxt_isolation.h> #include <nxt_isolation.h>
#if (NXT_HAVE_PIVOT_ROOT) #if (NXT_HAVE_MNTENT_H)
#include <mntent.h> #include <mntent.h>
#endif #endif