X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=server%2Feventl.c;h=a2d78719e1e13e1cafa96f4237f187add7583c07;hb=9158f8e318f25cb16171433742950236cae96d36;hp=f626799c2e0269ae256af796475d896f3a8a81f8;hpb=044d170f0a963555486df54653cd2fdc5815928b;p=yaz-moved-to-github.git diff --git a/server/eventl.c b/server/eventl.c index f626799..a2d7871 100644 --- a/server/eventl.c +++ b/server/eventl.c @@ -1,10 +1,23 @@ /* - * Copyright (c) 1995-1998, Index Data + * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: eventl.c,v $ - * Revision 1.26 1998-02-11 11:53:35 adam + * Revision 1.30 2001-10-05 13:55:17 adam + * Added defines YAZ_GNU_THREADS, YAZ_POSIX_THREADS in code and yaz-config + * + * Revision 1.29 1999/11/30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.28 1999/08/27 09:40:32 adam + * Renamed logf function to yaz_log. Removed VC++ project files. + * + * Revision 1.27 1999/02/02 13:57:34 adam + * Uses preprocessor define WIN32 instead of WINDOWS to build code + * for Microsoft WIN32. + * + * Revision 1.26 1998/02/11 11:53:35 adam * Changed code so that it compiles as C++. * * Revision 1.25 1998/01/29 13:30:23 adam @@ -87,10 +100,9 @@ * */ -#include #include #include -#ifdef WINDOWS +#ifdef WIN32 #include #else #include @@ -99,12 +111,22 @@ #include #include -#include -#include -#include +#include +#include +#include +#include #include "eventl.h" #include "session.h" -#include +#include + +#if YAZ_GNU_THREADS +#include +#define YAZ_EV_SELECT pth_select +#endif + +#ifndef YAZ_EV_SELECT +#define YAZ_EV_SELECT select +#endif IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) { @@ -152,7 +174,8 @@ int event_loop(IOCHAN *iochans) if (p->fd > max) max = p->fd; } - if ((res = select(max + 1, &in, &out, &except, timeout)) < 0) + res = YAZ_EV_SELECT(max + 1, &in, &out, &except, timeout); + if (res < 0) { if (errno == EINTR) continue; @@ -165,7 +188,7 @@ int event_loop(IOCHAN *iochans) cs_close(conn); destroy_association(assoc); iochan_destroy(*iochans); - logf(LOG_DEBUG, "error while selecting, destroying iochan %p", + yaz_log(LOG_DEBUG, "error select, destroying iochan %p", *iochans); } }