Blob Blame History Raw
Port the configure script to C99.  Add the missing int return type,
and avoid calling the undeclared exit function.

More or less submitted upstream:

  <https://bitbucket.org/tildeslash/monit/issues/1058/>

diff --git a/configure b/configure
index 5c4f1e64c5aae6e9..333844a0f0b8af7a 100755
--- a/configure
+++ b/configure
@@ -19167,12 +19167,12 @@ else
                 #include <netinet/in.h>
                 /* Make sure the definitions for AF_INET6 and struct sockaddr_in6
                  * are defined, and that we can actually create an IPv6 TCP socket.*/
-                main()
+                int main()
                 {
                         int fd;
                         struct sockaddr_in6 foo;
                         fd = socket(AF_INET6, SOCK_STREAM, 0);
-                        exit(fd >= 0 ? 0 : 1);
+                        return fd >= 0 ? 0 : 1;
                 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
diff --git a/configure.ac b/configure.ac
index cd79d897e8af9e85..7dabb3701a222daa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -448,12 +448,12 @@ AC_ARG_WITH(ipv6,
                 #include <netinet/in.h>
                 /* Make sure the definitions for AF_INET6 and struct sockaddr_in6
                  * are defined, and that we can actually create an IPv6 TCP socket.*/
-                main()
+                int main()
                 {
                         int fd;
                         struct sockaddr_in6 foo;
                         fd = socket(AF_INET6, SOCK_STREAM, 0);
-                        exit(fd >= 0 ? 0 : 1);
+                        return fd >= 0 ? 0 : 1;
                 }]])],
                 [ac_cv_ipv6=yes],
                 [ac_cv_ipv6=no],
diff --git a/libmonit/configure b/libmonit/configure
index af9afddf28d1caab..38e0332973a59863 100755
--- a/libmonit/configure
+++ b/libmonit/configure
@@ -18425,12 +18425,12 @@ else
                 #include <netinet/in.h>
                 /* Make sure the definitions for AF_INET6 and struct sockaddr_in6
                  * are defined, and that we can actually create an IPv6 TCP socket.*/
-                main()
+                int main()
                 {
                         int fd;
                         struct sockaddr_in6 foo;
                         fd = socket(AF_INET6, SOCK_STREAM, 0);
-                        exit(fd >= 0 ? 0 : 1);
+                        return fd >= 0 ? 0 : 1;
                 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
diff --git a/libmonit/configure.ac b/libmonit/configure.ac
index 74d246ae6a2def1b..ddc705a25643c98c 100644
--- a/libmonit/configure.ac
+++ b/libmonit/configure.ac
@@ -349,12 +349,12 @@ AC_ARG_WITH(ipv6,
                 #include <netinet/in.h>
                 /* Make sure the definitions for AF_INET6 and struct sockaddr_in6
                  * are defined, and that we can actually create an IPv6 TCP socket.*/
-                main()
+                int main()
                 {
                         int fd;
                         struct sockaddr_in6 foo;
                         fd = socket(AF_INET6, SOCK_STREAM, 0);
-                        exit(fd >= 0 ? 0 : 1);
+                        return fd >= 0 ? 0 : 1;
                 }]])],
                 [ac_cv_ipv6=yes],
                 [ac_cv_ipv6=no],