Commit ffa93c2a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

New option: "-llocale". Default is to never call setlocale().

parent a25ce76c
/*
* $Id: ramkomd.c,v 0.37 1993/10/12 21:05:46 ceder Exp $
* $Id: ramkomd.c,v 0.38 1993/10/13 00:10:32 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -31,7 +31,7 @@
* It has grown! /ceder
*/
static char *rcsid = "$Id: ramkomd.c,v 0.37 1993/10/12 21:05:46 ceder Exp $";
static char *rcsid = "$Id: ramkomd.c,v 0.38 1993/10/13 00:10:32 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -280,20 +280,12 @@ main (int argc,
{
int i;
char *dbase_dir = NULL;
char *use_locale = NULL;
log("*** Version %d (process %d) started.\n",
#include "version.incl"
, getpid());
#ifdef HAVE_LOCALE_H
if (setlocale(LC_CTYPE, "iso_8859_1") == NULL)
{
perror("setlocale");
exit(1);
}
#endif
#if defined (HAVE_SYSCONF)
MAX_NO_OF_CONNECTIONS = sysconf(_SC_OPEN_MAX) - PROTECTED_FDS;
#else
......@@ -341,6 +333,10 @@ main (int argc,
send_async_messages = FALSE;
break;
case 'l':
use_locale = argv[i]+2;
break;
#ifdef LOGACCESSES
case 'L':
logaccess_file = argv[i] + 2;
......@@ -349,7 +345,7 @@ main (int argc,
default:
restart_kom("usage: %s [-d] [-q] [-Ddir] [-pport] [-Pmuxport]"
" [-a]"
" [-a] [-llocale]"
#ifdef LOGACCESSES
" [-Ldb_trace_file]"
#endif
......@@ -359,9 +355,24 @@ main (int argc,
if (i < argc)
{
restart_kom("usage: %s [-d] [-q] [-Ddir] [-pport] [-Pmuxport]"
" [-a]\n", argv[0]);
" [-a] [-llocale]\n", argv[0]);
}
#ifdef HAVE_LOCALE_H
if (setlocale(LC_CTYPE, use_locale) == NULL)
{
fprintf(stderr, "setlocale: ");
perror(use_locale);
exit(1);
}
#else
if (use_locale != NULL)
{
fprintf(stderr, "locale not supported in your environment.\n");
exit(1);
}
#endif
signal(SIGHUP, sighandler_hup);
signal(SIGQUIT, sighandler_quit);
signal(SIGUSR1, sighandler_usr1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment