From d26af07e48057c5507de88d1ccff60fc5fa7079a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 23 Nov 2012 12:34:06 +0100 Subject: [PATCH] Build fix for *NIX. --- lib/base/stdiostream.cpp | 2 +- lib/base/unix.h | 1 + lib/base/unixsocket.cpp | 10 +++++----- lib/base/unixsocket.h | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/base/stdiostream.cpp b/lib/base/stdiostream.cpp index 5cf4bd661..b6e5ffec3 100644 --- a/lib/base/stdiostream.cpp +++ b/lib/base/stdiostream.cpp @@ -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(); } diff --git a/lib/base/unix.h b/lib/base/unix.h index e1f8e0bd7..df0b5e2a9 100644 --- a/lib/base/unix.h +++ b/lib/base/unix.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/base/unixsocket.cpp b/lib/base/unixsocket.cpp index 58d491620..d90978852 100644 --- a/lib/base/unixsocket.cpp +++ b/lib/base/unixsocket.cpp @@ -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 */ \ No newline at end of file +#endif /* _WIN32 */ diff --git a/lib/base/unixsocket.h b/lib/base/unixsocket.h index 5535d1001..3f278a101 100644 --- a/lib/base/unixsocket.h +++ b/lib/base/unixsocket.h @@ -30,6 +30,8 @@ public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; + UnixSocket(void); + void Bind(const String& path); void Connect(const String& path); @@ -38,4 +40,4 @@ public: } #endif /* _WIN32 */ -#endif /* UNIXSOCKET_H */ \ No newline at end of file +#endif /* UNIXSOCKET_H */ -- 2.40.0