diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-12 23:51:36 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-12 23:51:36 -0500 |
commit | a09f506ff3ed6a47eb7b3cb045164defd6b8d198 (patch) | |
tree | 191edf8dd4ceb479bcce7da7f0c9d983a78a417f /src | |
parent | ca6fb164907c3fb530f049864d6a986f85b22cdf (diff) | |
download | stasis-a09f506ff3ed6a47eb7b3cb045164defd6b8d198.tar.gz |
Add Delivery.info.time_str_epoch member to store Unix epoch as a string.
Diffstat (limited to 'src')
-rw-r--r-- | src/deliverable.c | 6 | ||||
-rw-r--r-- | src/main.c | 1 |
2 files changed, 7 insertions, 0 deletions
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) @@ -199,6 +199,7 @@ int main(int argc, char *argv[], char *arge[]) { tpl_register("meta.mission", &ctx.meta.mission); tpl_register("meta.python", &ctx.meta.python); tpl_register("meta.python_compact", &ctx.meta.python_compact); + tpl_register("info.time_str_epoch", &ctx.info.time_str_epoch); tpl_register("info.release_name", &ctx.info.release_name); tpl_register("conda.installer_baseurl", &ctx.conda.installer_baseurl); tpl_register("conda.installer_name", &ctx.conda.installer_name); |