From 5698c146564d8d7a185874ab180c4d8aa9e4f506 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 12 Apr 2024 08:55:55 -0400 Subject: Only initialize the time, release name, and deferred package arrays if required --- src/deliverable.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/deliverable.c b/src/deliverable.c index 8dd24f6..bf6d479 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -654,23 +654,21 @@ static int populate_delivery_cfg(struct Delivery *ctx) { return 0; } -char *bootstrap_build_name(struct Delivery *ctx) { - struct Delivery local; - memcpy(&local._omc_ini_fp, &ctx->_omc_ini_fp, sizeof(local._omc_ini_fp)); - - return NULL; -} - static int populate_info(struct Delivery *ctx) { - // Record timestamp used for release - time(&ctx->info.time_now); - ctx->info.time_info = localtime(&ctx->info.time_now); - ctx->info.time_str_epoch = calloc(OMC_TIME_STR_MAX, sizeof(*ctx->info.time_str_epoch)); if (!ctx->info.time_str_epoch) { - msg(OMC_MSG_ERROR, "Unable to allocate memory for Unix epoch string\n"); - return -1; + // Record timestamp used for release + time(&ctx->info.time_now); + ctx->info.time_info = localtime(&ctx->info.time_now); + + ctx->info.time_str_epoch = calloc(OMC_TIME_STR_MAX, sizeof(*ctx->info.time_str_epoch)); + if (!ctx->info.time_str_epoch) { + msg(OMC_MSG_ERROR, "Unable to allocate memory for Unix epoch string\n"); + return -1; + } + snprintf(ctx->info.time_str_epoch, OMC_TIME_STR_MAX - 1, "%li", ctx->info.time_now); } - snprintf(ctx->info.time_str_epoch, OMC_TIME_STR_MAX - 1, "%li", ctx->info.time_now); + return 0; +} return 0; } -- cgit