Changeset: cbf3b902b691 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cbf3b902b691
Modified Files:
        monetdb5/modules/mal/mal_mapi.c
        tools/merovingian/daemon/connections.c
        tools/merovingian/daemon/proxy.c
        tools/merovingian/utils/control.c
Branch: ipv6
Log Message:

Compilation fixes.


diffs (132 lines):

diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -623,7 +623,7 @@ SERVERlisten(int *Port, const char *Usoc
                                                e = errno;
                                                continue;
                                        }
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                                        (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
@@ -633,7 +633,7 @@ SERVERlisten(int *Port, const char *Usoc
                                                continue;
                                        }
 
-                                       bind_check = bind(sock, rp->ai_addr, 
rp->ai_addrlen);
+                                       bind_check = bind(sock, (SOCKPTR) 
rp->ai_addr, (socklen_t) rp->ai_addrlen);
                                        e = errno;
                                        if (bind_check == SOCKET_ERROR) {
                                                closesocket(sock);
@@ -669,9 +669,9 @@ SERVERlisten(int *Port, const char *Usoc
                                errno = e;
                                throw(IO, "mal_mapi.listen", OPERATION_FAILED 
": bind to stream socket port %d failed: %s", port,
 #ifdef _MSC_VER
-                                                                               
        wsaerror(WSAGetLastError())
+                                         wsaerror(WSAGetLastError())
 #else
-                                                                               
        strerror(errno)
+                                         strerror(errno)
 #endif
                                );
                        } while (1);
@@ -741,7 +741,7 @@ SERVERlisten(int *Port, const char *Usoc
                                else
                                        server_ipv4.sin_port = htons((unsigned 
short) ((port) & 0xFFFF));
 
-                               if (bind(sock, server, length) == SOCKET_ERROR) 
{
+                               if (bind(sock, (SOCKPTR) server, length) == 
SOCKET_ERROR) {
                                        int e = errno;
                                        if (
 #ifdef _MSC_VER
diff --git a/tools/merovingian/daemon/connections.c 
b/tools/merovingian/daemon/connections.c
--- a/tools/merovingian/daemon/connections.c
+++ b/tools/merovingian/daemon/connections.c
@@ -58,7 +58,7 @@ openConnectionTCP(int *ret, bool bind_ip
                                        , rp->ai_protocol);
                        if (sock == -1)
                                continue;
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                        (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
@@ -104,7 +104,7 @@ openConnectionTCP(int *ret, bool bind_ip
                }
                server = bind_ipv6 ? (struct sockaddr*) &server_ipv6 : (struct 
sockaddr*) &server_ipv4;
 
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
                if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &on, 
sizeof on) < 0) {
@@ -184,7 +184,7 @@ openConnectionUDP(int *ret, bool bind_ip
                                          , rp->ai_protocol);
                if (sock == -1)
                        continue;
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
@@ -234,7 +234,7 @@ openConnectionUNIX(int *ret, const char 
        if (sock == -1)
                return(newErr("creation of UNIX stream socket failed: %s",
                                        strerror(errno)));
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
        (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
diff --git a/tools/merovingian/daemon/proxy.c b/tools/merovingian/daemon/proxy.c
--- a/tools/merovingian/daemon/proxy.c
+++ b/tools/merovingian/daemon/proxy.c
@@ -150,7 +150,7 @@ startProxy(int psock, stream *cfdin, str
                                                        , 0)) == -1) {
                        return(newErr("cannot open socket: %s", 
strerror(errno)));
                }
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                (void) fcntl(ssock, F_SETFD, FD_CLOEXEC);
 #endif
                if (connect(ssock, (SOCKPTR) &server, sizeof(struct 
sockaddr_un)) == -1) {
@@ -231,7 +231,7 @@ startProxy(int psock, stream *cfdin, str
                                closesocket(ssock);
                                continue;
                        } else {
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                                (void) fcntl(ssock, F_SETFD, FD_CLOEXEC);
 #endif
                                break;
diff --git a/tools/merovingian/utils/control.c 
b/tools/merovingian/utils/control.c
--- a/tools/merovingian/utils/control.c
+++ b/tools/merovingian/utils/control.c
@@ -63,7 +63,7 @@ char* control_send(
                                        strerror(errno));
                        return(strdup(sbuf));
                }
-#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
                (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
                server = (struct sockaddr_un) {
@@ -106,7 +106,7 @@ char* control_send(
                if (rp == NULL) {
                        snprintf(sbuf, sizeof(sbuf), "cannot connect to %s:%s: 
%s", host, sport,
 #ifdef _MSC_VER
-                                       wsaerror(WSAGetLastError())
+                                        wsaerror(WSAGetLastError())
 #else
                                         strerror(errno)
 #endif
@@ -114,7 +114,7 @@ char* control_send(
                        return(strdup(sbuf));
                }
 #if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
-               (void) fcntl(s, F_SETFD, FD_CLOEXEC);
+               (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
                /* try reading length */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to