mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 12:44:58 +02:00
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)
|
void StdioStream::Close(void)
|
||||||
{
|
{
|
||||||
if (m_OwnsStream)
|
if (m_OwnsStream)
|
||||||
delete *m_InnerStream;
|
delete m_InnerStream;
|
||||||
|
|
||||||
Stream::Close();
|
Stream::Close();
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/un.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <netinet/in.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));
|
strncpy(sun.sun_path, path.CStr(), sizeof(sun.sun_path));
|
||||||
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
||||||
|
|
||||||
if (bind(GetFD(), (sockaddr *)&sun, SUN_LEN(sun)) < 0)
|
if (bind(GetFD(), (sockaddr *)&sun, SUN_LEN(&sun)) < 0)
|
||||||
throw_exception(PosixException("bind() failed", errno);
|
throw_exception(PosixException("bind() failed", errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnixSocket::Connect(const String& path)
|
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));
|
strncpy(sun.sun_path, path.CStr(), sizeof(sun.sun_path));
|
||||||
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
|
||||||
|
|
||||||
if (connect(GetFD(), (sockaddr *)&sun, SUN_LEN(sun)) < 0 && errno != EINPROGRESS)
|
if (connect(GetFD(), (sockaddr *)&sun, SUN_LEN(&sun)) < 0 && errno != EINPROGRESS)
|
||||||
throw_exception(PosixException("connect() failed", errno);
|
throw_exception(PosixException("connect() failed", errno));
|
||||||
}
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
@ -30,6 +30,8 @@ public:
|
|||||||
typedef shared_ptr<UnixSocket> Ptr;
|
typedef shared_ptr<UnixSocket> Ptr;
|
||||||
typedef weak_ptr<UnixSocket> WeakPtr;
|
typedef weak_ptr<UnixSocket> WeakPtr;
|
||||||
|
|
||||||
|
UnixSocket(void);
|
||||||
|
|
||||||
void Bind(const String& path);
|
void Bind(const String& path);
|
||||||
|
|
||||||
void Connect(const String& path);
|
void Connect(const String& path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user