]> granicus.if.org Git - icinga2/commitdiff
Build fix for *NIX.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 23 Nov 2012 11:34:06 +0000 (12:34 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 23 Nov 2012 11:34:06 +0000 (12:34 +0100)
lib/base/stdiostream.cpp
lib/base/unix.h
lib/base/unixsocket.cpp
lib/base/unixsocket.h

index 5cf4bd6615123224bc277285321a6dc69e1fb5db..b6e5ffec31bdb0d5ef56c9c9d9433d3ced9c4e6d 100644 (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();
 }
index e1f8e0bd7b166415147dc809d0ebda223fdf8ed7..df0b5e2a950b9ce711e4937463eda894f66f530c 100644 (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>
index 58d491620cdfc8d3f3ce0be1fa7ec8b8256394ba..d909788526ddce2ef6cbffc7bdfd52a7b9f360b1 100644 (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 */
\ No newline at end of file
+#endif /* _WIN32 */
index 5535d1001d137430e7334a4dd30281fe53e8e046..3f278a101d2ec471ea0ff5a9dca9232d58146ea2 100644 (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);
@@ -38,4 +40,4 @@ public:
 }
 #endif /* _WIN32 */
 
-#endif /* UNIXSOCKET_H */
\ No newline at end of file
+#endif /* UNIXSOCKET_H */