+void cfgfatal_maybefile(FILE *maybe_f, struct cloc loc, string_t facility,
+ char *message, ...)
+{
+ va_list args;
+
+ va_start(args,message);
+ vcfgfatal_maybefile(maybe_f,loc,facility,message,args);
+ va_end(args);
+}
+
+void cfgfatal(struct cloc loc, string_t facility, char *message, ...)
+{
+ va_list args;
+
+ va_start(args,message);
+ vcfgfatal_maybefile(0,loc,facility,message,args);
+ va_end(args);
+}
+
+void cfgfile_postreadcheck(struct cloc loc, FILE *f)
+{
+ assert(loc.file);
+ if (ferror(f)) {
+ Message(M_FATAL, "error reading config file (%s): %s",
+ loc.file, strerror(errno));
+ exit(current_phase);
+ } else if (feof(f)) {
+ Message(M_FATAL, "unexpected end of config file (%s)", loc.file);
+ exit(current_phase);
+ }
+}
+