X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=comstack%2Funix.c;fp=comstack%2Funix.c;h=4efed2736b133aefe7c792fefacde957c75d5a8f;hp=23c60ab709e0e1570306321e1907a208c51a6aa0;hb=bef6611df76c31df3c12bfe3f16084133ad5b52a;hpb=64fdfaf56bcdb9144ec528f01771967f9981679f diff --git a/comstack/unix.c b/comstack/unix.c index 23c60ab..4efed27 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.13 2003-09-16 20:48:28 adam Exp $ + * $Id: unix.c,v 1.14 2003-10-08 21:47:15 adam Exp $ * UNIX socket COMSTACK. By Morten Bøgeskov. */ #ifndef WIN32 @@ -40,7 +40,6 @@ static int unix_listen(COMSTACK h, char *raddr, int *addrlen, void *cd); static int unix_set_blocking(COMSTACK p, int blocking); - static COMSTACK unix_accept(COMSTACK h); static char *unix_addrstr(COMSTACK h); static void *unix_straddr(COMSTACK h, const char *str); @@ -100,7 +99,7 @@ COMSTACK unix_type(int s, int blocking, int protocol, void *vp) xmalloc(sizeof(unix_state))))) return 0; - if (!(p->blocking = blocking)) + if (!((p->blocking = blocking)&1)) { if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) return 0; @@ -369,8 +368,8 @@ static COMSTACK unix_accept(COMSTACK h) } return 0; } - if (!cnew->blocking && - (!cnew->blocking && fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) + if (!(cnew->blocking&1) && + (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) ) { h->cerrno = CSYSERR;