* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: unix.c,v 1.10 2003-02-21 12:08:58 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
#include <yaz/comstack.h>
#include <yaz/unix.h>
#include <yaz/log.h>
+#include <yaz/nmem.h>
#ifndef YAZ_SOCKLEN_T
#define YAZ_SOCKLEN_T int
h->cerrno = CSYSERR;
return -1;
}
+ chmod(path, 0777);
if (mode == CS_SERVER && listen(h->iofile, 3) < 0)
{
h->cerrno = CSYSERR;
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)
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;