mirror of https://github.com/Icinga/icinga2.git
Build fix for Solaris.
This commit is contained in:
parent
1ec7c223d4
commit
ab6b46786b
|
@ -84,8 +84,19 @@ void Socket::SetFD(SOCKET fd)
|
||||||
{
|
{
|
||||||
unsigned long lTrue = 1;
|
unsigned long lTrue = 1;
|
||||||
|
|
||||||
if (fd != INVALID_SOCKET)
|
if (fd != INVALID_SOCKET) {
|
||||||
|
#ifdef F_GETFL
|
||||||
|
int flags;
|
||||||
|
flags = fcntl(fd, F_GETFL, 0);
|
||||||
|
if (flags < 0)
|
||||||
|
throw PosixException("fcntl failed", errno);
|
||||||
|
|
||||||
|
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0)
|
||||||
|
throw PosixException("fcntl failed", errno);
|
||||||
|
#else /* F_GETFL */
|
||||||
ioctlsocket(fd, FIONBIO, &lTrue);
|
ioctlsocket(fd, FIONBIO, &lTrue);
|
||||||
|
#endif /* F_GETFL */
|
||||||
|
}
|
||||||
|
|
||||||
m_FD = fd;
|
m_FD = fd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,9 @@ void closesocket(SOCKET fd);
|
||||||
|
|
||||||
#define ioctlsocket ioctl
|
#define ioctlsocket ioctl
|
||||||
|
|
||||||
#define MAXPATHLEN PATH_MAX
|
#ifndef MAXPATHLEN
|
||||||
|
# define MAXPATHLEN PATH_MAX
|
||||||
|
#endif /* MAXPATHLEN */
|
||||||
|
|
||||||
/* default visibility takes care of exported symbols */
|
/* default visibility takes care of exported symbols */
|
||||||
#define I2_EXPORT
|
#define I2_EXPORT
|
||||||
|
|
Loading…
Reference in New Issue