Only call ioctlsocket() on Windows.
This commit is contained in:
parent
edebf579f2
commit
fec14791e8
1 changed files with 2 additions and 0 deletions
|
@ -436,11 +436,13 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MINGW
|
||||||
unsigned long arg = 0;
|
unsigned long arg = 0;
|
||||||
|
|
||||||
if(ioctlsocket(fd, FIONBIO, &arg) != 0) {
|
if(ioctlsocket(fd, FIONBIO, &arg) != 0) {
|
||||||
fprintf(stderr, "ioctlsocket failed: %s", sockstrerror(sockerrno));
|
fprintf(stderr, "ioctlsocket failed: %s", sockstrerror(sockerrno));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
|
if(connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue