Build fix for *NIX.

This commit is contained in:
Gunnar Beutner 2012-11-23 12:34:06 +01:00
parent 0785a082e9
commit d26af07e48
4 changed files with 10 additions and 7 deletions

View File

@ -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();
}

View File

@ -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>

View File

@ -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 */

View File

@ -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);