mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
read config file before change working dir
This commit is contained in:
parent
795bc1b3a7
commit
56a3b3f3df
1 changed files with 5 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue