aboutsummaryrefslogtreecommitdiff
path: root/src/lib/delivery/delivery.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/delivery/delivery.c')
-rw-r--r--src/lib/delivery/delivery.c24
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';