Determine the correct daemon dir. */
| 497 | |
| 498 | /* Determine the correct daemon dir. */ |
| 499 | static const char *find_daemon_dir(struct lightningd *ld, const char *argv0) |
| 500 | { |
| 501 | const char *my_path = find_my_directory(ld, argv0); |
| 502 | /* If we're running in-tree, all the subdaemons are with lightningd. */ |
| 503 | if (has_all_subdaemons(my_path)) { |
| 504 | /* In this case, look for built-in plugins in ../plugins */ |
| 505 | plugins_set_builtin_plugins_dir(ld->plugins, |
| 506 | path_join(tmpctx, |
| 507 | my_path, |
| 508 | "../plugins")); |
| 509 | return my_path; |
| 510 | } |
| 511 | |
| 512 | /* Otherwise we assume they're in the installed dir. */ |
| 513 | return find_my_pkglibexec_path(ld, take(my_path)); |
| 514 | } |
| 515 | |
| 516 | /*~ We like to free everything on exit, so valgrind doesn't complain (valgrind |
| 517 | * is an awesome runtime memory usage detector for C and C++ programs). In |
no test coverage detected