From c3b984a6d1cf19b1731b7e783ae2c0fd539277ac Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 3 Jul 2002 13:36:55 +0000 Subject: [PATCH] unix sockets for zoom --- comstack/unix.c | 6 +++++- zoom/zoom-c.c | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/comstack/unix.c b/comstack/unix.c index 7666b29..fa26bb8 100644 --- a/comstack/unix.c +++ b/comstack/unix.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * - * $Id: unix.c,v 1.2 2002-06-18 21:30:38 adam Exp $ + * $Id: unix.c,v 1.3 2002-07-03 13:36:55 adam Exp $ * UNIX socket COMSTACK. By Morten Bøgeskov. */ #ifndef WIN32 @@ -143,11 +143,15 @@ COMSTACK unix_type(int s, int blocking, int protocol, void *vp) int unix_strtoaddr_ex(const char *str, struct sockaddr_un *add) { + char *cp; if (!unix_init ()) return 0; TRC(fprintf(stderr, "unix_strtoaddress: %s\n", str ? str : "NULL")); add->sun_family = AF_UNIX; strncpy(add->sun_path, str, sizeof(add->sun_path)); + cp = strchr (add->sun_path, ':'); + if (cp) + *cp = '\0'; return 1; } diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index d5e5d83..cbcb028 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.34 2002-07-01 12:59:12 adam Exp $ + * $Id: zoom-c.c,v 1.35 2002-07-03 13:36:55 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -208,10 +208,13 @@ static char **set_DatabaseNames (ZOOM_connection con, ZOOM_options options, if (!cp || !*cp) { - cp = strchr (con->host_port, '/'); + if (strncmp (con->host_port, "unix:", 5) == 0) + cp = strchr (con->host_port+5, ':'); + else + cp = strchr (con->host_port, '/'); if (cp) cp++; - } + } if (cp) { c = cp; -- 1.7.10.4