X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=server%2Fstatserv.c;h=f5fb325b934992f71615c276fd66a79ebfac33b9;hp=84190dda2ed3794a2ff1462bf82f7421535a8d11;hb=bcd497eb945e135d9693ca7f1c0285930a0622fa;hpb=2f5c9e5bc97a81a1e83f825146453a4a89696274 diff --git a/server/statserv.c b/server/statserv.c index 84190dd..f5fb325 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: statserv.c,v $ - * Revision 1.10 1995-03-29 15:40:16 quinn + * Revision 1.13 1995-03-30 16:08:39 quinn + * Little mods. + * + * Revision 1.12 1995/03/30 13:29:02 quinn + * Smallish + * + * Revision 1.11 1995/03/30 12:18:17 quinn + * Fixed bug. + * + * Revision 1.10 1995/03/29 15:40:16 quinn * Ongoing work. Statserv is now dynamic by default * * Revision 1.9 1995/03/27 08:34:30 quinn @@ -56,8 +65,11 @@ #include #include #include +#ifdef USE_XTIMOSI #include +#endif #include +#include static char *me = ""; static int dynamic = 1; /* fork on incoming connection */ @@ -210,6 +222,7 @@ static void add_listener(char *where, int what) } type = tcpip_type; } +#ifdef USE_XTIMOSI else if (!strcmp(mode, "osi")) { if (!(ap = mosi_strtoaddr(addr))) @@ -219,6 +232,7 @@ static void add_listener(char *where, int what) } type = mosi_type; } +#endif else { fprintf(stderr, "You must specify either 'osi:' or 'tcp:'.\n"); @@ -254,10 +268,12 @@ int statserv_main(int argc, char **argv) { int ret, listeners = 0; char *arg; - int protocol = CS_Z3950;; + int protocol = CS_Z3950; + char *logfile = 0; + int loglevel = LOG_DEFAULT_LEVEL; me = argv[0]; - while ((ret = options("szSl:", argv, argc, &arg)) != -2) + while ((ret = options("szSl:v:", argv, argc, &arg)) != -2) switch (ret) { case 0: @@ -267,8 +283,16 @@ int statserv_main(int argc, char **argv) case 'z': protocol = CS_Z3950; break; case 's': protocol = CS_SR; break; case 'S': dynamic = 0; break; + case 'l': + logfile = arg; + log_init(loglevel, me, logfile); + break; + case 'v': + loglevel = log_mask_str(arg); + log_init(loglevel, me, logfile); + break; default: - fprintf(stderr, "Usage: %s [ -zsS ... ]\n", me); + fprintf(stderr, "Usage: %s [ -v -l -zsS ... ]\n", me); exit(1); } if (dynamic)