diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-10 08:51:10 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-10 08:51:10 -0400 | 
| commit | 3e76a1ed3755cbdf3b186df22a40cbd851f32a93 (patch) | |
| tree | ba79cf3c31c6efda7ef7f9ba3c68a22b51b5851e /src/main.c | |
| parent | 145d42ab8d22a6b6661c2c75e6e640db35a6a2ea (diff) | |
| download | ohmycal-3e76a1ed3755cbdf3b186df22a40cbd851f32a93.tar.gz | |
Consolidate INIFILE handling across the delivery context
* Break delivery_init() into separate populate_* functions
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 15 | 
1 files changed, 11 insertions, 4 deletions
@@ -285,20 +285,27 @@ int main(int argc, char *argv[]) {      if (config_input) {          msg(OMC_MSG_L2, "Reading OMC global configuration: %s\n", config_input); -        cfg = ini_open(config_input); -        if (!cfg) { + +        ctx._omc_ini_fp.cfg = ini_open(config_input); +        if (!ctx._omc_ini_fp.cfg) {              msg(OMC_MSG_ERROR | OMC_MSG_L2, "Failed to read config file: %s, %s\n", delivery_input, strerror(errno));              exit(1);          } +        ctx._omc_ini_fp.cfg_path = strdup(config_input);          guard_free(config_input);      }      msg(OMC_MSG_L2, "Reading OMC delivery configuration: %s\n", delivery_input); -    ini = ini_open(delivery_input); -    if (!ini) { +    ctx._omc_ini_fp.delivery = ini_open(delivery_input); +    if (!ctx._omc_ini_fp.delivery) {          msg(OMC_MSG_ERROR | OMC_MSG_L2, "Failed to read delivery file: %s, %s\n", delivery_input, strerror(errno));          exit(1);      } +    ctx._omc_ini_fp.delivery_path = strdup(delivery_input); + + +    extern char *bootstrap_build_name(struct Delivery *ctx); +    bootstrap_build_name(&ctx);      msg(OMC_MSG_L2, "Initializing delivery context\n");      if (delivery_init(&ctx)) {  | 
