MCPcopy Create free account
hub / github.com/ElementsProject/lightning / find_daemon_dir

Function find_daemon_dir

lightningd/lightningd.c:499–514  ·  view source on GitHub ↗

Determine the correct daemon dir. */

Source from the content-addressed store, hash-verified

497
498/* Determine the correct daemon dir. */
499static 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

Callers 1

mainFunction · 0.85

Calls 5

find_my_directoryFunction · 0.85
has_all_subdaemonsFunction · 0.85
path_joinFunction · 0.85
find_my_pkglibexec_pathFunction · 0.85

Tested by

no test coverage detected