X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=index%2Fzserver.c;h=8889dadcc1cdedd6d898bdec77c23da1d7d45f93;hb=10ccfd152f58ba6d9ae9f958d8710656f1e3dfdd;hp=af32209a63b116fbffd2b90d33b153e6bd4ec8d5;hpb=c5bed3b13630bf1d194e821ab51113c37c70abe7;p=idzebra-moved-to-github.git diff --git a/index/zserver.c b/index/zserver.c index af32209..8889dad 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,5 +1,5 @@ -/* $Id: zserver.c,v 1.107 2003-05-24 22:35:11 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: zserver.c,v 1.110 2003-08-21 10:30:04 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps This file is part of the Zebra server. @@ -264,7 +264,7 @@ int bend_search (void *handle, bend_search_rr *r) switch (r->query->which) { case Z_Query_type_1: case Z_Query_type_101: - zebra_search_RPN (zh, r->query->u.type_1, + zebra_search_RPN (zh, r->stream, r->query->u.type_1, r->setname, &r->hits); zebra_result (zh, &r->errcode, &r->errstring); if (!r->errcode) @@ -382,6 +382,7 @@ static int es_admin_request (ZebraHandle zh, Z_AdminEsRequest *r) break; case Z_ESAdminOriginPartToKeep_drop: yaz_log(LOG_LOG, "adm-drop"); + zebra_drop_database (zh, r->toKeep->databaseName); break; case Z_ESAdminOriginPartToKeep_create: yaz_log(LOG_LOG, "adm-create %s", r->toKeep->databaseName); @@ -656,20 +657,24 @@ static void bend_start (struct statserv_options_block *sob) #else if (!sob->inetd) { + char pidfname[4096]; struct flock area; - char *pidfile = "zebrasrv.pid"; - int fd = open (pidfile, O_EXCL|O_WRONLY|O_CREAT, 0666); + int fd; + + zebra_pidfname(sob->handle, pidfname); + + fd = open (pidfname, O_EXCL|O_WRONLY|O_CREAT, 0666); if (fd == -1) { if (errno != EEXIST) { - yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfile); + yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname); exit(1); } - fd = open(pidfile, O_RDWR, 0666); + fd = open(pidfname, O_RDWR, 0666); if (fd == -1) { - yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfile); + yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname); exit(1); } } @@ -698,7 +703,11 @@ static void bend_stop(struct statserv_options_block *sob) #else if (!sob->inetd) - unlink ("zebrasrv.pid"); + { + char pidfname[4096]; + zebra_pidfname(sob->handle, pidfname); + unlink (pidfname); + } #endif if (sob->handle) {