X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzserver.c;h=4cfeb3a5180565b74a7dbd9380b9917f801b5c5e;hb=92bb4bdb37873f21cabe7b045e1a593ab648ae55;hp=3f10faf0204a32ad2c7e0491ef02029071cb3040;hpb=ef696645cc3b7e0f4027008d1dc589c0f0f90c1f;p=idzebra-moved-to-github.git diff --git a/index/zserver.c b/index/zserver.c index 3f10faf..4cfeb3a 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -4,7 +4,21 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.c,v $ - * Revision 1.68 1999-05-26 07:49:13 adam + * Revision 1.72 1999-10-29 10:01:54 adam + * Minor fix in bend_init where handle wasn't set to NULL when + * zebra_init fails. + * + * Revision 1.71 1999/07/14 10:59:26 adam + * Changed functions isc_getmethod, isams_getmethod. + * Improved fatal error handling (such as missing EXPLAIN schema). + * + * Revision 1.70 1999/06/10 12:14:56 adam + * Fixed to use bend_start instead of pre_init. + * + * Revision 1.69 1999/06/10 09:20:03 adam + * Minor change to pre_init handler. + * + * Revision 1.68 1999/05/26 07:49:13 adam * C++ compilation. * * Revision 1.67 1999/02/02 14:51:14 adam @@ -257,7 +271,6 @@ #endif #include -#include #include "zserver.h" @@ -279,6 +292,7 @@ bend_initresult *bend_init (bend_initrequest *q) char *user = NULL; char *passwd = NULL; + r->handle = 0; r->errcode = 0; r->errstring = 0; q->bend_sort = bend_sort; @@ -433,20 +447,22 @@ int bend_sort (void *handle, bend_sort_rr *rr) } #ifndef WIN32 -static void pre_init (struct statserv_options_block *sob) +static void bend_start (struct statserv_options_block *sob) { - char *pidfile = "zebrasrv.pid"; - int fd = creat (pidfile, 0666); - - if (fd == -1) - logf (LOG_WARN|LOG_ERRNO, "creat %s", pidfile); - else + if (!sob->inetd) { - char pidstr[30]; + char *pidfile = "zebrasrv.pid"; + int fd = creat (pidfile, 0666); + if (fd == -1) + logf (LOG_WARN|LOG_ERRNO, "creat %s", pidfile); + else + { + char pidstr[30]; - sprintf (pidstr, "%ld", (long) getpid ()); - write (fd, pidstr, strlen(pidstr)); - close (fd); + sprintf (pidstr, "%ld", (long) getpid ()); + write (fd, pidstr, strlen(pidstr)); + close (fd); + } } } #endif @@ -458,7 +474,7 @@ int main (int argc, char **argv) sob = statserv_getcontrol (); strcpy (sob->configname, FNAME_CONFIG); #ifndef WIN32 - sob->pre_init = pre_init; + sob->bend_start = bend_start; #endif statserv_setcontrol (sob);