X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=comstack%2Funix.c;fp=comstack%2Funix.c;h=edfa830a23496905c483e0c2a56cc9cbf50894d4;hb=ca4948d9b8ea1e4d73d25a25b1da3a4de121ca73;hp=222817ee7c8fb07fb2519e9904df0505b5e36924;hpb=2309bff1f17207f5952803760becd2390f7f8ea3;p=yaz-moved-to-github.git diff --git a/comstack/unix.c b/comstack/unix.c index 222817e..edfa830 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.4 2002-07-22 23:16:10 adam Exp $ + * $Id: unix.c,v 1.5 2002-09-10 20:56:34 adam Exp $ * UNIX socket COMSTACK. By Morten Bøgeskov. */ #ifndef WIN32 @@ -26,6 +26,16 @@ /* Chas added the following, so we get the definition of completeBER */ #include +#if HAVE_SOCKLEN_T +#define NET_LEN_T socklen_t +#else +#if GETPEERNAME_ACCEPTS_SIZE_T_FOR_THIRD_ARGUMENT +#define NET_LEN_T size_t +#else +#define NET_LEN_T int +#endif +#endif + int unix_close(COMSTACK h); int unix_put(COMSTACK h, char *buf, int size); int unix_get(COMSTACK h, char **buf, int *bufsize); @@ -305,11 +315,7 @@ int unix_listen(COMSTACK h, char *raddr, int *addrlen, void *cd) { struct sockaddr_un addr; -#ifdef __cplusplus - socklen_t len = SUN_LEN(&addr); -#else - int len = SUN_LEN(&addr); -#endif + NET_LEN_T len = SUN_LEN(&addr); TRC(fprintf(stderr, "unix_listen pid=%d\n", getpid())); if (h->state != CS_ST_IDLE)