X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzserver.c;h=55789598709401e46af00f8b3ab01e94fcf36a91;hb=84e7aa0b86a8a2841f9a379129d0de24d9803463;hp=f187c17d8d511bb7c2e8971b172b19a7f1693f7a;hpb=b6830e77ae855c0be7fcf4352a5d88477f4c83b0;p=idzebra-moved-to-github.git diff --git a/index/zserver.c b/index/zserver.c index f187c17..5578959 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $Id: zserver.c,v 1.109 2003-07-02 22:00:06 adam Exp $ +/* $Id: zserver.c,v 1.112 2003-11-09 11:48:16 oleg Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -149,7 +149,7 @@ bend_initresult *bend_init (bend_initrequest *q) if (selected) zebra_record_encoding (zh, right_name); q->charneg_response = - yaz_set_response_charneg (q->stream, right_name, + yaz_set_response_charneg (q->stream, charsets[i], 0, selected); break; } else { @@ -657,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,8 +702,12 @@ static void bend_stop(struct statserv_options_block *sob) #ifdef WIN32 #else - if (!sob->inetd) - unlink ("zebrasrv.pid"); + if (!sob->inetd && sob->handle) + { + char pidfname[4096]; + zebra_pidfname(sob->handle, pidfname); + unlink (pidfname); + } #endif if (sob->handle) {