Browse Source

[1452] added missing config.h (otherwise HAVE_SA_LEN wouldn't be recognized).
also corrected the assignment for sun_len.

JINMEI Tatuya 13 years ago
parent
commit
43df0d5564
2 changed files with 5 additions and 1 deletions
  1. 3 1
      src/lib/util/io/socketsession.cc
  2. 2 0
      src/lib/util/tests/socketsession_unittest.cc

+ 3 - 1
src/lib/util/io/socketsession.cc

@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -105,7 +107,7 @@ SocketSessionForwarder::SocketSessionForwarder(const std::string& unix_file) :
     assert(impl.sock_un_.sun_path[sizeof(impl.sock_un_.sun_path) - 1] == '\0');
     impl.sock_un_len_ = 2 + unix_file.length();
 #ifdef HAVE_SA_LEN
-    impl.sock_un_.sun_len = sock_un_len_;
+    impl.sock_un_.sun_len = impl.sock_un_len_;
 #endif
     impl.fd_ = -1;
 

+ 2 - 0
src/lib/util/tests/socketsession_unittest.cc

@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>