attempt to fix compilation on windows

This commit is contained in:
csoler 2021-12-19 17:44:23 +01:00
parent 6048a9a011
commit 37d4e4f3df
3 changed files with 5 additions and 24 deletions

View File

@ -61,14 +61,7 @@ bool RsTcpSocket::connect()
}
mState = CONNECTED;
#ifndef WINDOWS_SYS
int flags = fcntl(CreateSocket,F_GETFL);
fcntl(CreateSocket, F_SETFL, flags | O_NONBLOCK);
#else
unsigned long int on = 1;
ret = ioctlsocket(fd, FIONBIO, &on);
#endif
unix_fcntl_nonblock(CreateSocket);
setSocket(CreateSocket);
return true;

View File

@ -175,14 +175,7 @@ static bool test_listening_port(const std::string& /*address*/,uint16_t port)
close(sockfd);
return false;
}
#ifndef WINDOWS_SYS
int flags = fcntl(sockfd, F_GETFL);
fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
#else
unsigned long int on = 1;
ret = ioctlsocket(fd, FIONBIO, &on);
#endif
unix_fcntl_nonblock(sockfd);
int res = listen(sockfd,5);
int err = errno;

View File

@ -272,14 +272,9 @@ void TorProcess::start()
}
int flags ;
#ifndef WINDOWS_SYS
flags = fcntl(fd[STDOUT_FILENO], F_GETFL); fcntl(fd[STDOUT_FILENO], F_SETFL, flags | O_NONBLOCK);
flags = fcntl(fd[STDERR_FILENO], F_GETFL); fcntl(fd[STDERR_FILENO], F_SETFL, flags | O_NONBLOCK);
#else
unsigned long int on = 1;
ret = ioctlsocket(fd[STDOUT_FILENO], FIONBIO, &on);
ret = ioctlsocket(fd[STDERR_FILENO], FIONBIO, &on);
#endif
unix_fcntl_nonblock(fd[STDOUT_FILENO]);
unix_fcntl_nonblock(fd[STDERR_FILENO]);
mStdOutFD = new RsFdBinInterface(fd[STDOUT_FILENO]);
mStdErrFD = new RsFdBinInterface(fd[STDERR_FILENO]);
}