(dflt_econfig): New.

(emp_config): Use it when argument is NULL.  This simplifies callers
except pconfig's main(), which now has to suppress reading the default
file.  Also fix callers to check the return value.  Previously, a typo
could easily start a grossly misconfigured program, with potentially
disastrous results.
This commit is contained in:
Markus Armbruster 2005-03-09 17:11:58 +00:00
parent 12518b82dd
commit 1583d0c6a2
7 changed files with 23 additions and 32 deletions

View file

@ -191,7 +191,6 @@ main(int argc, char *argv[])
{
int opt;
char *config_file = NULL;
char tbuf[512];
int i = 0;
rnd_seed = time(NULL);
@ -222,11 +221,8 @@ main(int argc, char *argv[])
}
}
srandom(rnd_seed);
if (config_file == NULL) {
sprintf(tbuf, "%s/econfig", datadir);
config_file = tbuf;
}
emp_config(config_file);
if (emp_config(config_file))
exit(1);
parse_args(argc - optind, argv + optind);
if (allocate_memory() == -1)