summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-24 14:48:56 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-24 14:48:56 +0100
commiteb3617c426b8efc9021c94d2e1b9669eebbe1034 (patch)
treeea04f17e3fb02c8d27a5e20b254f72ecf7dc0916 /source3
parentd4c4cb06c52f6ded7d55d75201fb2107e76c1586 (diff)
downloadsamba-eb3617c426b8efc9021c94d2e1b9669eebbe1034.tar.gz
samba-eb3617c426b8efc9021c94d2e1b9669eebbe1034.tar.bz2
samba-eb3617c426b8efc9021c94d2e1b9669eebbe1034.zip
ctdb_conn: Avoid sys_connect.
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/ctdbd_conn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index b5c8280c4d..36e9e508f0 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -203,6 +203,7 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx,
const char *sockname = lp_ctdbd_socket();
struct sockaddr_un addr;
int fd;
+ socklen_t salen;
if (!sockname || !*sockname) {
sockname = CTDB_PATH;
@@ -218,7 +219,8 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx,
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, sockname, sizeof(addr.sun_path));
- if (sys_connect(fd, (struct sockaddr *)(void *)&addr) == -1) {
+ salen = sizeof(struct sockaddr_un);
+ if (connect(fd, (struct sockaddr *)(void *)&addr, salen) == -1) {
DEBUG(1, ("connect(%s) failed: %s\n", sockname,
strerror(errno)));
close(fd);