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.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.c')
| -rw-r--r-- | src/lib/delivery/delivery.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/lib/delivery/delivery.c b/src/lib/delivery/delivery.c index 45b3b35..a150169 100644 --- a/src/lib/delivery/delivery.c +++ b/src/lib/delivery/delivery.c @@ -1,16 +1,6 @@ #include "delivery.h" +#include "conda.h" -static char *strdup_maybe(const char * restrict s) { - if (s != NULL) { - char *x = strdup(s); - if (!x) { - SYSERROR("%s", "strdup failed"); - exit(1); - } - return x; - } - return NULL; -} struct Delivery *delivery_duplicate(const struct Delivery *ctx) { struct Delivery *result = calloc(1, sizeof(*result)); if (!result) { @@ -62,20 +52,20 @@ struct Delivery *delivery_duplicate(const struct Delivery *ctx) { memcpy(&result->rules.content, &ctx->rules.content, sizeof(ctx->rules.content)); if (ctx->rules._handle) { - SYSDEBUG("%s", "duplicating INIFILE handle - BEGIN"); + SYSDEBUG("duplicating INIFILE handle - BEGIN"); result->rules._handle = malloc(sizeof(*result->rules._handle)); if (!result->rules._handle) { - SYSERROR("%s", "unable to allocate space for INIFILE handle"); + SYSERROR("unable to allocate space for INIFILE handle"); return NULL; } result->rules._handle->section = malloc(ctx->rules._handle->section_count * sizeof(**ctx->rules._handle->section)); if (!result->rules._handle->section) { guard_free(result->rules._handle); - SYSERROR("%s", "unable to allocate space for INIFILE section"); + SYSERROR("unable to allocate space for INIFILE section"); return NULL; } memcpy(result->rules._handle, &ctx->rules._handle, sizeof(*ctx->rules._handle)); - SYSDEBUG("%s", "duplicating INIFILE handle - END"); + SYSDEBUG("duplicating INIFILE handle - END"); } // Runtime @@ -111,7 +101,7 @@ struct Delivery *delivery_duplicate(const struct Delivery *ctx) { if (ctx->system.platform) { result->system.platform = malloc(DELIVERY_PLATFORM_MAX * sizeof(*result->system.platform)); if (!result->system.platform) { - SYSERROR("%s", "unable to allocate space for system platform array"); + SYSERROR("unable to allocate space for system platform array"); return NULL; } for (size_t i = 0; i < DELIVERY_PLATFORM_MAX; i++) { @@ -364,7 +354,7 @@ void delivery_defer_packages(struct Delivery *ctx, int type) { deferred = ctx->conda.pip_packages_defer; strncpy(mode, "pip", sizeof(mode) - 1); } else { - SYSERROR("BUG: type %d does not map to a supported package manager!\n", type); + SYSERROR("BUG: type %d does not map to a supported package manager!", type); exit(1); } mode[sizeof(mode) - 1] = '\0'; |
