[PATCH v2 14/25] Including <sys/un.h> iff it exists.

Alejandro Colomar alx.manpages at gmail.com
Mon Jun 20 07:10:57 UTC 2022


---
 auto/headers         | 13 +++++++++++++
 src/nxt_socket_msg.h |  2 +-
 src/nxt_unix.h       |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/auto/headers b/auto/headers
index dee13ead..98865630 100644
--- a/auto/headers
+++ b/auto/headers
@@ -157,3 +157,16 @@ nxt_feature_test="#include <sys/signalfd.h>
                       return 0;
                   }"
 . auto/feature
+
+
+nxt_feature="<sys/un.h>"
+nxt_feature_name=NXT_HAVE_SYS_UN_H
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="#include <sys/un.h>
+
+                  int main(void) {
+                      return 0;
+                  }"
+. auto/feature
diff --git a/src/nxt_socket_msg.h b/src/nxt_socket_msg.h
index 04de1761..3601c6b8 100644
--- a/src/nxt_socket_msg.h
+++ b/src/nxt_socket_msg.h
@@ -5,7 +5,7 @@
 #ifndef _NXT_SOCKET_MSG_H_INCLUDED_
 #define _NXT_SOCKET_MSG_H_INCLUDED_
 
-#if (NXT_HAVE_UCRED)
+#if (NXT_HAVE_SYS_UN_H)
 #include <sys/un.h>
 #endif
 
diff --git a/src/nxt_unix.h b/src/nxt_unix.h
index 9100cccf..5d7a59b6 100644
--- a/src/nxt_unix.h
+++ b/src/nxt_unix.h
@@ -178,7 +178,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/uio.h>
-#if (NXT_HAVE_UNIX_DOMAIN)
+#if (NXT_HAVE_SYS_UN_H)
 #include <sys/un.h>
 #endif
 #include <sys/wait.h>
-- 
2.36.1



More information about the unit mailing list