X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=comstack%2Funix.c;h=23c60ab709e0e1570306321e1907a208c51a6aa0;hb=ea8a7e8ee5a459c4a995bf7d422ae2bca97c644d;hp=22087ead5a08b4859402c264c6b5471b7740ba46;hpb=2703ec73c9d338d55387ec3f787d0a7f30289cff;p=yaz-moved-to-github.git diff --git a/comstack/unix.c b/comstack/unix.c index 22087ea..23c60ab 100644 --- a/comstack/unix.c +++ b/comstack/unix.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: unix.c,v 1.12 2003-05-14 13:49:02 adam Exp $ + * $Id: unix.c,v 1.13 2003-09-16 20:48:28 adam Exp $ * UNIX socket COMSTACK. By Morten Bøgeskov. */ #ifndef WIN32 @@ -308,7 +308,7 @@ static int unix_listen(COMSTACK h, char *raddr, int *addrlen, void *cd) { struct sockaddr_un addr; - YAZ_SOCKLEN_T len = SUN_LEN(&addr); + YAZ_SOCKLEN_T len = sizeof(addr); TRC(fprintf(stderr, "unix_listen pid=%d\n", getpid())); if (h->state != CS_ST_IDLE) @@ -388,6 +388,7 @@ static COMSTACK unix_accept(COMSTACK h) state->altsize = state->altlen = 0; state->towrite = state->written = -1; state->complete = st->complete; + memcpy(&state->addr, &st->addr, sizeof(state->addr)); cnew->state = CS_ST_ACCEPT; cnew->event = CS_NONE; h->state = CS_ST_IDLE;