From a09f506ff3ed6a47eb7b3cb045164defd6b8d198 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 12 Feb 2024 23:51:36 -0500 Subject: Add Delivery.info.time_str_epoch member to store Unix epoch as a string. --- src/deliverable.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/deliverable.c') diff --git a/src/deliverable.c b/src/deliverable.c index 6d868e0..72e4eff 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -277,6 +277,12 @@ int delivery_init(struct Delivery *ctx, struct INIFILE *ini, struct INIFILE *cfg // 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); if (cfg) { getter(cfg, "default", "conda_staging_dir", INIVAL_TYPE_STR) -- cgit