]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix org#2666 About fixing getaddrinfo check in ./configure
authorEric Bollengier <eric@baculasystems.com>
Tue, 10 Jan 2023 17:17:51 +0000 (18:17 +0100)
committerEric Bollengier <eric@baculasystems.com>
Tue, 10 Jan 2023 17:20:58 +0000 (18:20 +0100)
Thanks to Florian Weimer

The exit function is not declared in this context, so the check will always
fail with compilers which do not accept implicit function declarations. Change
the return type of main to int and return directly from main instead.

bacula/autoconf/configure.in

index 0df382866cd234aa340d24e3075a3052b2982849..6dec88657bbf50553dcfe639c3e190b7621c0a6a 100644 (file)
@@ -2586,7 +2586,7 @@ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
              #include <sys/types.h>
              #include <sys/socket.h>
 
-             void main(void) {
+             int main(void) {
                  struct addrinfo hints, *ai;
                  int error;
 
@@ -2595,12 +2595,12 @@ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
                  hints.ai_socktype = SOCK_STREAM;
                  error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
                  if (error) {
-                     exit(1);
+                     return(1);
                  }
                  if (ai->ai_addr->sa_family != AF_INET) {
-                     exit(1);
+                     return(1);
                  }
-                 exit(0);
+                 return(0);
              }
          ],[
              ac_cv_working_getaddrinfo="yes"