Browse code

Respect HAVE_SOCKADDR_SA_LEN, so that t_write_unix() works in systems where there is a sa_len member in the sockaddr structure.

Maxim Sobolev authored on 10/01/2005 08:32:41
Showing 1 changed files
... ...
@@ -914,10 +914,13 @@ static int write_to_unixsock(char* sockname, int cnt)
914 914
 		LOG(L_ERR, "write_to_unixsock: Socket name too long\n");
915 915
 		return -1;
916 916
 	}
917
-	
917
+
918 918
 	memset(&dest, 0, sizeof(dest));
919 919
 	dest.sun_family = PF_LOCAL;
920 920
 	memcpy(dest.sun_path, sockname, len);
921
+#ifdef HAVE_SOCKADDR_SA_LEN
922
+	dest.sun_len = len;
923
+#endif
921 924
 	
922 925
 	if (connect(sock, (struct sockaddr*)&dest, SUN_LEN(&dest)) == -1) {
923 926
 		LOG(L_ERR, "write_to_unixsock: Error in connect: %s\n", strerror(errno));