diff options
-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); |