aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 08:55:55 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 08:56:31 -0400
commit5698c146564d8d7a185874ab180c4d8aa9e4f506 (patch)
treee98db7b1e68ef58c0001fd065ba66c693c28633e
parenta2ccdd2a14b79ebb3770ea3eb9c220c32f804969 (diff)
downloadstasis-5698c146564d8d7a185874ab180c4d8aa9e4f506.tar.gz
Only initialize the time, release name, and deferred package arrays if required
-rw-r--r--src/deliverable.c26
1 files changed, 12 insertions, 14 deletions
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;
}