attempt to fix compilation on windows

This commit is contained in:
csoler 2021-12-19 16:52:43 +01:00
parent 40b965cab1
commit 6048a9a011
4 changed files with 27 additions and 6 deletions

View file

@ -175,8 +175,13 @@ 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
int res = listen(sockfd,5);

View file

@ -272,9 +272,14 @@ 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
mStdOutFD = new RsFdBinInterface(fd[STDOUT_FILENO]);
mStdErrFD = new RsFdBinInterface(fd[STDERR_FILENO]);
}