Commit 3007f6bf authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(initialize): Removed the aux_def_file argument. All callers updated.

	Get the file of the aux_def_file from the config file.
(main): Removed the -c and -a options.  This reverts the change in rev
	0.64.  It is more consistent to get the file name of the
	aux-def file from the config file.  The -c option was buggy anyhow.
parent 4d9a49dc
/*
* $Id: ramkomd.c,v 0.66 1998/07/12 01:24:19 ceder Exp $
* $Id: ramkomd.c,v 0.67 1998/08/07 23:32:08 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -39,7 +39,7 @@
*/
static const char *
rcsid = "$Id: ramkomd.c,v 0.66 1998/07/12 01:24:19 ceder Exp $";
rcsid = "$Id: ramkomd.c,v 0.67 1998/08/07 23:32:08 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -337,14 +337,14 @@ go_daemon(void)
}
static void
initialize(const char *config_file, char *aux_def_file)
initialize(const char *config_file)
{
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
struct rlimit rlim;
#endif
read_configuration(config_file);
initialize_aux_items(aux_def_file);
initialize_aux_items(param.aux_def_file);
#ifdef HAVE_LOCALE_H
if (param.use_locale != NULL)
......@@ -424,8 +424,6 @@ main (int argc,
int i;
char *default_config_file;
char *config_file;
char *default_aux_def_file;
char *aux_def_file;
#ifdef HAVE_STRUCT_SIGACTION
struct sigaction act;
#endif
......@@ -441,19 +439,6 @@ main (int argc,
/* Initialize the string handling package. */
s_set_storage_management(string_malloc, string_realloc, string_free);
/* Set default file names */
default_config_file = smalloc(strlen(DEFAULT_DBASE_DIR) +
strlen(CONFIG_FILE) + 2);
default_aux_def_file = smalloc(strlen(DEFAULT_DBASE_DIR) +
strlen(AUX_DEF_FILE) + 2);
sprintf(default_config_file, "%s/%s", DEFAULT_DBASE_DIR, CONFIG_FILE);
sprintf(default_aux_def_file, "%s/%s", DEFAULT_DBASE_DIR, AUX_DEF_FILE);
config_file = default_config_file;
aux_def_file = default_aux_def_file;
/* Parse command line arguments. */
for (i = 1; i < argc && argv[i][0] == '-'; i++)
switch (argv[i][1])
......@@ -462,21 +447,16 @@ main (int argc,
buglevel++;
break;
case 'c':
config_file = argv[i++];
break;
case 'a':
aux_def_file = argv[i++];
break;
default:
restart_kom("usage: %s [-d ...] [-c config-file] [-a aux-ite-defs] [config-file]\n", argv[0]);
restart_kom("usage: %s [-d ...] [config-file]\n", argv[0]);
}
/* Read in the configuration file. */
default_config_file = smalloc(strlen(DEFAULT_DBASE_DIR) +
strlen(CONFIG_FILE) + 2);
sprintf(default_config_file, "%s/%s", DEFAULT_DBASE_DIR, CONFIG_FILE);
if (i < argc)
config_file = argv[i++];
else
......@@ -507,9 +487,7 @@ main (int argc,
signal(SIGUSR2, sighandler_usr2);
#endif
/* Read config, listen, and start db */
initialize(config_file, aux_def_file);
initialize(config_file); /* Read config, listen, and start db */
chdir(param.core_dir);
sfree(default_config_file);
......
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