From: patthoyts Date: Fri, 21 Mar 2003 23:05:13 +0000 (+0000) Subject: define ioctlsocket for unix X-Git-Tag: tcludp-1_0_5~6 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=cb1c492c12114342af1ef7f95ac93cac52c4716b;p=tcludp define ioctlsocket for unix --- diff --git a/generic/udp_tcl.c b/generic/udp_tcl.c index 5f88749..0fc7677 100644 --- a/generic/udp_tcl.c +++ b/generic/udp_tcl.c @@ -39,7 +39,9 @@ /* define some Win32isms for Unix */ #ifndef WIN32 #define SOCKET int +#define INVALID_SOCKET -1 #define closesocket close +#define ioctlsocket ioctl #endif #ifdef DEBUG @@ -236,11 +238,9 @@ udpOpen(ClientData clientData, Tcl_Interp *interp, Tcl_AppendResult(interp, errBuf, (char *)NULL); return TCL_ERROR; } -#ifdef WIN32 + ioctlsocket(sock, FIONBIO, &status); -#else - ioctl(sock, (int) FIONBIO, &status); -#endif + if (localport == 0) { len = sizeof(sockaddr); getsockname(sock, (struct sockaddr *)&sockaddr, &len);