mirror of https://github.com/Icinga/icinga2.git
Build fix for *NIX.
This commit is contained in:
parent
0785a082e9
commit
d26af07e48
|
@ -83,7 +83,7 @@ void StdioStream::Write(const void *buffer, size_t size)
|
|||
void StdioStream::Close(void)
|
||||
{
|
||||
if (m_OwnsStream)
|
||||
delete *m_InnerStream;
|
||||
delete m_InnerStream;
|
||||
|
||||
Stream::Close();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
|
|
|
@ -41,8 +41,8 @@ void UnixSocket::Bind(const String& path)
|
|||
strncpy(sun.sun_path, path.CStr(), sizeof(sun.sun_path));
|
||||
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
||||
|
||||
if (bind(GetFD(), (sockaddr *)&sun, SUN_LEN(sun)) < 0)
|
||||
throw_exception(PosixException("bind() failed", errno);
|
||||
if (bind(GetFD(), (sockaddr *)&sun, SUN_LEN(&sun)) < 0)
|
||||
throw_exception(PosixException("bind() failed", errno));
|
||||
}
|
||||
|
||||
void UnixSocket::Connect(const String& path)
|
||||
|
@ -52,7 +52,7 @@ void UnixSocket::Connect(const String& path)
|
|||
strncpy(sun.sun_path, path.CStr(), sizeof(sun.sun_path));
|
||||
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
||||
|
||||
if (connect(GetFD(), (sockaddr *)&sun, SUN_LEN(sun)) < 0 && errno != EINPROGRESS)
|
||||
throw_exception(PosixException("connect() failed", errno);
|
||||
if (connect(GetFD(), (sockaddr *)&sun, SUN_LEN(&sun)) < 0 && errno != EINPROGRESS)
|
||||
throw_exception(PosixException("connect() failed", errno));
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
|
|
@ -30,6 +30,8 @@ public:
|
|||
typedef shared_ptr<UnixSocket> Ptr;
|
||||
typedef weak_ptr<UnixSocket> WeakPtr;
|
||||
|
||||
UnixSocket(void);
|
||||
|
||||
void Bind(const String& path);
|
||||
|
||||
void Connect(const String& path);
|
||||
|
@ -38,4 +40,4 @@ public:
|
|||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#endif /* UNIXSOCKET_H */
|
||||
#endif /* UNIXSOCKET_H */
|
||||
|
|
Loading…
Reference in New Issue