(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:
parent
12518b82dd
commit
1583d0c6a2
7 changed files with 23 additions and 32 deletions
|
@ -33,10 +33,6 @@
|
|||
* Doug Hay, 1998
|
||||
*/
|
||||
|
||||
#if defined(aix) || defined(linux)
|
||||
#include <unistd.h>
|
||||
#endif /* aix or linux */
|
||||
|
||||
#include <signal.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/ioctl.h>
|
||||
|
@ -189,11 +185,8 @@ main(int argc, char **argv)
|
|||
return remove_service(service_name);
|
||||
#endif /* _WIN32 */
|
||||
|
||||
if (config_file == NULL) {
|
||||
sprintf(tbuf, "%s/econfig", datadir);
|
||||
config_file = tbuf;
|
||||
}
|
||||
emp_config(config_file);
|
||||
if (emp_config(config_file) < 0)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
#if defined(_WIN32)
|
||||
if (install_service_set)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue