/* config stuff */
if(!(cfg = config_create()))
fatal_exit("Could not alloc config defaults");
- if(!config_read(cfg, cfgfile))
- fatal_exit("Could not read config file: %s", cfgfile);
+ if(!config_read(cfg, cfgfile)) {
+ if(errno != ENOENT)
+ fatal_exit("Could not read config file: %s",
+ cfgfile);
+ log_warn("Continuing with default config settings");
+ }
apply_settings(daemon, cfg, cmdline_verbose);
/* prepare */
+14 February 2008: Wouter
+ - start without a config file (will complain, but start with
+ defaults).
+
13 February 2008: Wouter
- 0.9 released.
- 1.0 development. Printout ldns version on unbound -h.
if(cfg_parser->errors != 0) {
fprintf(stderr, "read %s failed: %d errors in configuration file\n",
cfg_parser->filename, cfg_parser->errors);
+ errno=EINVAL;
return 0;
}
return 1;
* Read the config file from the specified filename.
* @param config: where options are stored into, must be freshly created.
* @param filename: name of configfile. If NULL nothing is done.
- * @return: false on error.
+ * @return: false on error. In that case errno is set, ENOENT means
+ * file not found.
*/
int config_read(struct config_file* config, char* filename);