Browse Source

read config file before change working dir

trytravis
arowser 6 years ago
committed by Rusty Russell
parent
commit
56a3b3f3df
  1. 10
      lightningd/options.c

10
lightningd/options.c

@ -837,6 +837,11 @@ void handle_early_opts(struct lightningd *ld, int argc, char *argv[])
void handle_opts(struct lightningd *ld, int argc, char *argv[])
{
/* Now look for config file, but only handle non-early
* options, early ones have been parsed in
* handle_early_opts */
opt_parse_from_config(ld, false);
/* Move to config dir, to save ourselves the hassle of path manip. */
if (chdir(ld->config_dir) != 0) {
log_unusual(ld->log, "Creating configuration directory %s",
@ -849,11 +854,6 @@ void handle_opts(struct lightningd *ld, int argc, char *argv[])
ld->config_dir, strerror(errno));
}
/* Now look for config file, but only handle non-early
* options, early ones have been parsed in
* handle_early_opts */
opt_parse_from_config(ld, false);
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc != 1)
errx(1, "no arguments accepted");

Loading…
Cancel
Save