From 36179e624e04fd44e462d87f54037c9c4fbc46b3 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 14 Feb 2026 11:39:03 +0000 Subject: Correct error handling and comment in createconfigfile(). --- config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index b2868b1..9957e19 100644 --- a/config.c +++ b/config.c @@ -279,7 +279,7 @@ int getconfint(char *confname, char *filename) { } // Create the default configuration file. -// Return 1 on success, 0 on failure. +// Return 0 on success, exits on failure. int createconfigfile(char *filename) { char *dirtmp; char *dir; @@ -438,7 +438,9 @@ int createconfigfile(char *filename) { // Write complete string to file if ((fprintf(fp, "%s", string)) < 0) { - debugprint(DEBUG_CRIT, "error: could not write to replay log file.\n"); + printf("Error writing default config file '%s'.\n", filename); + debugprint(DEBUG_CRIT, "Error writing default config file '%s'.\n", filename); + exit(1); } fclose(fp); -- cgit v1.2.3