Просмотр исходного кода

Fixed to get IPv6 to compile on Solaris

Eric Stanley 12 лет назад
Родитель
Сommit
63711ec6e9
3 измененных файлов с 11 добавлено и 2 удалено
  1. 4 0
      src/check_nrpe.c
  2. 5 1
      src/nrpe.c
  3. 2 1
      src/utils.c

+ 4 - 0
src/check_nrpe.c

@@ -41,7 +41,11 @@ int show_license=FALSE;
 int show_version=FALSE;
 
 #ifdef HAVE_SSL
+#ifdef __sun
+SSL_METHOD *meth;
+#else
 const SSL_METHOD *meth;
+#endif
 SSL_CTX *ctx;
 SSL *ssl;
 int use_ssl=TRUE;

+ 5 - 1
src/nrpe.c

@@ -40,7 +40,11 @@ int deny_severity=LOG_WARNING;
 #endif
 
 #ifdef HAVE_SSL
+#ifdef __sun
+SSL_METHOD *meth;
+#else
 const SSL_METHOD *meth;
+#endif
 SSL_CTX *ctx;
 int use_ssl=TRUE;
 #else
@@ -840,7 +844,7 @@ void create_listener(struct addrinfo *ai) {
 	if (ai->ai_family == AF_INET6) {
 		if (setsockopt(listen_sock, IPPROTO_IPV6, IPV6_V6ONLY, &flag, 
 				sizeof(flag)) == -1) {
-			error("setsockopt IPV6_V6ONLY: %s", strerror(errno));
+			fprintf(stderr, "setsockopt IPV6_V6ONLY: %s", strerror(errno));
 			}
 		}
 #endif

+ 2 - 1
src/utils.c

@@ -171,7 +171,8 @@ int my_connect(const char *host, struct sockaddr_storage * hostaddr, u_short por
 
 	/* Return failure if we didn't get a successful connection. */
 	if (sock == -1) {
-		error("connect to host %s port %s: %s", host, strport, strerror(errno));
+		fprintf(stderr, "connect to host %s port %s: %s", host, strport, 
+				strerror(errno));
 		return -1;
 		}
 	return sock;