utils: remove tal_tmpctx altogether, use global.

In particular, we now only free tmpctx at the end of main().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-15 16:40:20 +10:30
parent 40fe5b7bac
commit 0a6e3d1e13
45 changed files with 115 additions and 375 deletions

View File

@@ -136,10 +136,12 @@ char *opt_subd_dev_disconnect(const char *optarg UNNEEDED, struct lightningd *ld
#undef main
int main(int argc UNUSED, char *argv[] UNUSED)
{
char *tmpctx = tal_tmpctx(NULL);
char *argv0;
/* We're assuming we're run from top build dir. */
const char *answer = path_canon(tmpctx, "lightningd/test");
const char *answer;
setup_tmpctx();
answer = path_canon(tmpctx, "lightningd/test");
/* Various different ways we could find ourselves. */
argv0 = path_join(tmpctx,