diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-24 19:15:28 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-24 19:15:28 -0400 |
commit | 1559605c1d1fc9670e87a349580a170c60049e2b (patch) | |
tree | d9ff8073b6d91cba70e488e569678c68b34eb421 | |
parent | a932b819cec18ada8f8f6c831c2b9fe1d77fb27f (diff) | |
download | stasis-1559605c1d1fc9670e87a349580a170c60049e2b.tar.gz |
Move deliver_init_tmpdir() next to path_store() call to clarify what is happening to tmpdir
-rw-r--r-- | src/deliverable.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/deliverable.c b/src/deliverable.c index e00d615..36df20a 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -105,7 +105,9 @@ int delivery_init_tmpdir(struct Delivery *ctx) { } globals.tmpdir = strdup(tmpdir); - ctx->storage.tmpdir = strdup(globals.tmpdir); + if (!ctx->storage.tmpdir) { + ctx->storage.tmpdir = strdup(globals.tmpdir); + } return unusable; l_delivery_init_tmpdir_fatal: @@ -216,6 +218,12 @@ void delivery_init_dirs_stage1(struct Delivery *ctx) { } path_store(&ctx->storage.tools_dir, PATH_MAX, ctx->storage.root, "tools"); path_store(&ctx->storage.tmpdir, PATH_MAX, ctx->storage.root, "tmp"); + if (delivery_init_tmpdir(ctx)) { + msg(OMC_MSG_ERROR | OMC_MSG_L1, "Set $TMPDIR to a location other than %s\n", globals.tmpdir); + if (globals.tmpdir) + guard_free(globals.tmpdir); + exit(1); + } path_store(&ctx->storage.build_dir, PATH_MAX, ctx->storage.root, "build"); path_store(&ctx->storage.build_recipes_dir, PATH_MAX, ctx->storage.build_dir, "recipes"); @@ -229,13 +237,6 @@ void delivery_init_dirs_stage1(struct Delivery *ctx) { path_store(&ctx->storage.mission_dir, PATH_MAX, globals.sysconfdir, "mission"); } - if (delivery_init_tmpdir(ctx)) { - msg(OMC_MSG_ERROR | OMC_MSG_L1, "Set $TMPDIR to a location other than %s\n", globals.tmpdir); - if (globals.tmpdir) - guard_free(globals.tmpdir); - exit(1); - } - if (access(ctx->storage.mission_dir, F_OK)) { msg(OMC_MSG_L1, "%s: %s\n", ctx->storage.mission_dir, strerror(errno)); exit(1); |