X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Funix.c;h=ea8d0cce2a2922d462bcace8c700c4c58a2f8538;hp=75b3f67d487dedee49bd9e44f0190cc481219f98;hb=1fbd038d97d6e1bfe97270ecc17cca123bcc435c;hpb=2788a4851b551e1a3efb320a2878b809f2d8a9d7 diff --git a/src/unix.c b/src/unix.c index 75b3f67..ea8d0cc 100644 --- a/src/unix.c +++ b/src/unix.c @@ -1,11 +1,14 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** * \file unix.c * \brief Implements UNIX domain socket COMSTACK */ +#if HAVE_CONFIG_H +#include +#endif #ifndef WIN32 @@ -38,7 +41,7 @@ #endif #include -#include +#include #ifndef YAZ_SOCKLEN_T #define YAZ_SOCKLEN_T int @@ -52,7 +55,7 @@ #endif #endif -static int unix_close(COMSTACK h); +static void unix_close(COMSTACK h); static int unix_put(COMSTACK h, char *buf, int size); static int unix_get(COMSTACK h, char **buf, int *bufsize); static int unix_connect(COMSTACK h, void *address); @@ -65,7 +68,7 @@ static int unix_listen(COMSTACK h, char *raddr, int *addrlen, static int unix_set_blocking(COMSTACK p, int blocking); static COMSTACK unix_accept(COMSTACK h); -static char *unix_addrstr(COMSTACK h); +static const char *unix_addrstr(COMSTACK h); static void *unix_straddr(COMSTACK h, const char *str); #ifndef SUN_LEN @@ -157,7 +160,6 @@ COMSTACK unix_type(int s, int flags, int protocol, void *vp) p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */ p->event = CS_NONE; p->cerrno = 0; - p->stackerr = 0; p->user = 0; state->altbuf = 0; @@ -701,7 +703,7 @@ static int unix_put(COMSTACK h, char *buf, int size) return 0; } -static int unix_close(COMSTACK h) +static void unix_close(COMSTACK h) { unix_state *sp = (struct unix_state *)h->cprivate; @@ -714,10 +716,9 @@ static int unix_close(COMSTACK h) xfree(sp->altbuf); xfree(sp); xfree(h); - return 0; } -static char *unix_addrstr(COMSTACK h) +static const char *unix_addrstr(COMSTACK h) { unix_state *sp = (struct unix_state *)h->cprivate; char *buf = sp->buf; @@ -745,6 +746,7 @@ static int unix_set_blocking(COMSTACK p, int flags) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab