From daba3f8b54b04fe8623db3bab90c3aba15d4c379 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sun, 9 Dec 2007 13:28:00 -0800 Subject: Fix connect(2) callers to use correct sockaddr size. Some systems (eg Mac OSX 10.5) require the length passed to match the socket address family. This introduces sys_connect() that does the right thing, and replaces all uses oc connect(2) with sys_connect(). Note that there are some LGPL callers that still call connect(2) directly. (This used to be commit e1bfdc17c49da582cdf907e260301ab1946b2ed3) --- source3/lib/ctdbd_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/ctdbd_conn.c') diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 47693ec621..899bbcfcce 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -135,7 +135,7 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx, addr.sun_family = AF_UNIX; strncpy(addr.sun_path, sockname, sizeof(addr.sun_path)); - if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { + if (sys_connect(fd, (struct sockaddr *)&addr) == -1) { DEBUG(0, ("connect(%s) failed: %s\n", sockname, strerror(errno))); close(fd); -- cgit