Add OID-database entries for the MARC, BIB-2 and ZeeRex attribute sets.
[yaz-moved-to-github.git] / comstack / unix.c
index 7666b29..222817e 100644 (file)
@@ -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.4 2002-07-22 23:16:10 adam Exp $
  * UNIX socket COMSTACK. By Morten Bøgeskov.
  */
 #ifndef WIN32
@@ -43,6 +43,10 @@ COMSTACK unix_accept(COMSTACK h);
 char *unix_addrstr(COMSTACK h);
 void *unix_straddr(COMSTACK h, const char *str);
 
+#ifndef SUN_LEN
+#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+                     + strlen ((ptr)->sun_path))
+#endif
 #if 0
 #define TRC(x) x
 #else
@@ -143,11 +147,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;
 }