Index: parse.y =================================================================== RCS file: /cvs/src/sbin/unwind/parse.y,v retrieving revision 1.29 diff -u -p -r1.29 parse.y --- parse.y 22 Oct 2021 15:03:28 -0000 1.29 +++ parse.y 21 Mar 2022 04:46:54 -0000 @@ -786,8 +786,9 @@ popfile(void) } struct uw_conf * -parse_config(char *filename) +parse_config(const char *filename) { + extern const char default_conffile[]; static enum uw_resolver_type default_res_pref[] = { UW_RES_DOT, UW_RES_ODOT_FORWARDER, @@ -807,10 +808,10 @@ parse_config(char *filename) for (i = 0; i < conf->res_pref.len; i++) conf->enabled_resolvers[conf->res_pref.types[i]] = 1; - file = pushfile(filename != NULL ? filename : _PATH_CONF_FILE, 0); + file = pushfile(filename, 0); if (file == NULL) { /* no default config file is fine */ - if (errno == ENOENT && filename == NULL) + if (errno == ENOENT && filename == default_conffile) return (conf); log_warn("%s", filename); free(conf); Index: unwind.c =================================================================== RCS file: /cvs/src/sbin/unwind/unwind.c,v retrieving revision 1.67 diff -u -p -r1.67 unwind.c --- unwind.c 18 Dec 2021 10:34:19 -0000 1.67 +++ unwind.c 21 Mar 2022 04:46:54 -0000 @@ -78,7 +78,8 @@ void send_blocklist_fd(void); struct uw_conf *main_conf; static struct imsgev *iev_frontend; static struct imsgev *iev_resolver; -char *conffile; +const char default_conffile[] = _PATH_CONF_FILE; +const char *conffile = default_conffile; pid_t frontend_pid; pid_t resolver_pid; uint32_t cmd_opts; Index: unwind.h =================================================================== RCS file: /cvs/src/sbin/unwind/unwind.h,v retrieving revision 1.56 diff -u -p -r1.56 unwind.h --- unwind.h 31 Aug 2021 20:18:03 -0000 1.56 +++ unwind.h 21 Mar 2022 04:46:54 -0000 @@ -193,7 +193,7 @@ void config_clear(struct uw_conf *); void print_config(struct uw_conf *); /* parse.y */ -struct uw_conf *parse_config(char *); +struct uw_conf *parse_config(const char *); int cmdline_symset(char *); RB_PROTOTYPE(force_tree, force_tree_entry, entry, force_tree_cmp);