diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-05-10 20:03:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-10 20:03:12 -0400 |
| commit | 58d3ca17dcd3f8b3aeb50b8e4f24afc76d33ff26 (patch) | |
| tree | 965264cfc865df78276da47eece86130a6b2b6b5 /src/lib/delivery/delivery_init.c | |
| parent | 0ef06cbec6f3796db244501b4c5fec2d579c7e5b (diff) | |
| parent | 70f20294bd63e9774ee0c8a7a032ac63e1a1da2e (diff) | |
| download | stasis-58d3ca17dcd3f8b3aeb50b8e4f24afc76d33ff26.tar.gz | |
Merge pull request #142 from jhunkeler/execpoint
Improve messaging functions
Diffstat (limited to 'src/lib/delivery/delivery_init.c')
| -rw-r--r-- | src/lib/delivery/delivery_init.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/lib/delivery/delivery_init.c b/src/lib/delivery/delivery_init.c index 024815b..8e673ff 100644 --- a/src/lib/delivery/delivery_init.c +++ b/src/lib/delivery/delivery_init.c @@ -1,3 +1,6 @@ +#include <fnmatch.h> +#include <sys/utsname.h> + #include "delivery.h" int has_mount_flags(const char *mount_point, const unsigned long flags) { @@ -21,13 +24,13 @@ int delivery_init_tmpdir(struct Delivery *ctx) { tmpdir = strdup(x); if (!tmpdir) { // memory error - SYSERROR("%s", "unable to allocate tmpdir"); + SYSERROR("unable to allocate tmpdir"); goto l_delivery_init_tmpdir_fatal; } } else { tmpdir = strdup("/tmp/stasis"); if (!tmpdir) { - SYSERROR("%s", "unable to allocate tmpdir"); + SYSERROR("unable to allocate tmpdir"); goto l_delivery_init_tmpdir_fatal; } //need_setenv = 1; @@ -36,7 +39,7 @@ int delivery_init_tmpdir(struct Delivery *ctx) { if (!ctx->storage.tmpdir) { ctx->storage.tmpdir = strdup(tmpdir); if (!ctx->storage.tmpdir) { - SYSERROR("%s", "unable to allocate ctx->storage.tmpdir"); + SYSERROR("unable to allocate ctx->storage.tmpdir"); goto l_delivery_init_tmpdir_fatal; } } else { @@ -44,7 +47,7 @@ int delivery_init_tmpdir(struct Delivery *ctx) { guard_free(tmpdir); tmpdir = strdup(ctx->storage.tmpdir); if (!tmpdir) { - SYSERROR("%s", "unable to allocate tmpdir"); + SYSERROR("unable to allocate tmpdir"); goto l_delivery_init_tmpdir_fatal; } } @@ -82,7 +85,7 @@ int delivery_init_tmpdir(struct Delivery *ctx) { if (!globals.tmpdir || strcmp(globals.tmpdir, ctx->storage.tmpdir) != 0) { globals.tmpdir = strdup(tmpdir); if (!globals.tmpdir) { - SYSERROR("%s", "unable to allocate globals.tmpdir"); + SYSERROR("unable to allocate globals.tmpdir"); goto l_delivery_init_tmpdir_fatal; } } @@ -90,7 +93,7 @@ int delivery_init_tmpdir(struct Delivery *ctx) { if (!ctx->storage.tmpdir) { ctx->storage.tmpdir = strdup(globals.tmpdir); if (!ctx->storage.tmpdir) { - SYSERROR("%s", "unable to allocate globals.tmpdir"); + SYSERROR("unable to allocate globals.tmpdir"); goto l_delivery_init_tmpdir_fatal; } } @@ -182,7 +185,7 @@ void delivery_init_dirs_stage1(struct Delivery *ctx) { } int delivery_init_platform(struct Delivery *ctx) { - SYSDEBUG("%s", "Setting architecture"); + SYSDEBUG("Setting architecture"); char archsuffix[20]; struct utsname uts; if (uname(&uts)) { @@ -192,7 +195,7 @@ int delivery_init_platform(struct Delivery *ctx) { ctx->system.platform = calloc(DELIVERY_PLATFORM_MAX + 1, sizeof(*ctx->system.platform)); if (!ctx->system.platform) { - SYSERROR("Unable to allocate %d records for platform array\n", DELIVERY_PLATFORM_MAX); + SYSERROR("Unable to allocate %d records for platform array", DELIVERY_PLATFORM_MAX); return -1; } for (size_t i = 0; i < DELIVERY_PLATFORM_MAX; i++) { @@ -212,7 +215,7 @@ int delivery_init_platform(struct Delivery *ctx) { } archsuffix[sizeof(archsuffix) - 1] = '\0'; - SYSDEBUG("%s", "Setting platform"); + SYSDEBUG("Setting platform"); strncpy(ctx->system.platform[DELIVERY_PLATFORM], uts.sysname, DELIVERY_PLATFORM_MAXLEN - 1); if (!strcmp(ctx->system.platform[DELIVERY_PLATFORM], "Darwin")) { snprintf(ctx->system.platform[DELIVERY_PLATFORM_CONDA_SUBDIR], DELIVERY_PLATFORM_MAXLEN, "osx-%s", archsuffix); @@ -343,22 +346,22 @@ int bootstrap_build_info(struct Delivery *ctx) { local._stasis_ini_fp.delivery = ini_open(ctx->_stasis_ini_fp.delivery_path); if (delivery_init_platform(&local)) { - SYSDEBUG("%s", "delivery_init_platform failed"); + SYSDEBUG("delivery_init_platform failed"); delivery_free(&local); return -1; } if (populate_delivery_cfg(&local, INI_READ_RENDER)) { - SYSDEBUG("%s", "populate_delivery_cfg failed"); + SYSDEBUG("populate_delivery_cfg failed"); delivery_free(&local); return -1; } if (populate_delivery_ini(&local, INI_READ_RENDER)) { - SYSDEBUG("%s", "populate_delivery_ini failed"); + SYSDEBUG("populate_delivery_ini failed"); delivery_free(&local); return -1; } if (populate_info(&local)) { - SYSDEBUG("%s", "populate_info failed"); + SYSDEBUG("populate_info failed"); delivery_free(&local); return -1; } @@ -376,7 +379,7 @@ int bootstrap_build_info(struct Delivery *ctx) { memcpy(ctx->info.time_info, local.info.time_info, sizeof(*local.info.time_info)); ctx->info.time_now = local.info.time_now; ctx->info.time_str_epoch = strdup(local.info.time_str_epoch); - SYSDEBUG("%s", "delivery_free local resources"); + SYSDEBUG("delivery_free local resources"); delivery_free(&local); return 0; } |
