@@ -41,11 +41,11 @@ if (_socket != OFInvalidSocketHandle) @throw [OFAlreadyConnectedException exceptionWithSocket: self]; address = OFSocketAddressMakeUNIX(path); - if ((_socket = socket(address.sockaddr.sockaddr.sa_family, + if ((_socket = socket(address.sockaddr.un.sun_family, SOCK_STREAM | SOCK_CLOEXEC, 0)) == OFInvalidSocketHandle) @throw [OFConnectionFailedException exceptionWithPath: path socket: self errNo: OFSocketErrNo()]; @@ -55,11 +55,12 @@ #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) if ((flags = fcntl(_socket, F_GETFD, 0)) != -1) fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif - if (connect(_socket, &address.sockaddr.sockaddr, address.length) != 0) { + if (connect(_socket, (struct sockaddr *)&address.sockaddr, + address.length) != 0) { int errNo = OFSocketErrNo(); closesocket(_socket); _socket = OFInvalidSocketHandle; @@ -79,11 +80,11 @@ if (_socket != OFInvalidSocketHandle) @throw [OFAlreadyConnectedException exceptionWithSocket: self]; address = OFSocketAddressMakeUNIX(path); - if ((_socket = socket(address.sockaddr.sockaddr.sa_family, + if ((_socket = socket(address.sockaddr.un.sun_family, SOCK_STREAM | SOCK_CLOEXEC, 0)) == OFInvalidSocketHandle) @throw [OFBindFailedException exceptionWithPath: path socket: self errNo: OFSocketErrNo()]; @@ -93,11 +94,12 @@ #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) if ((flags = fcntl(_socket, F_GETFD, 0)) != -1) fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif - if (bind(_socket, &address.sockaddr.sockaddr, address.length) != 0) { + if (bind(_socket, (struct sockaddr *)&address.sockaddr, + address.length) != 0) { int errNo = OFSocketErrNo(); closesocket(_socket); _socket = OFInvalidSocketHandle;