diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-07-13 12:17:29 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-07-13 12:17:29 -0400 |
commit | eb206c71778ad1f4171c09e328ef962a0ac8c873 (patch) | |
tree | 881b77e5c119a37b33dac9558562220f6c9aaaa5 | |
parent | 8ce824ac4b2f526331093a7150e643700efd4d20 (diff) | |
download | stasis-eb206c71778ad1f4171c09e328ef962a0ac8c873.tar.gz |
Change return value of conda_setup_headless() from void to int
* Replace exit() with return;
-rw-r--r-- | include/conda.h | 2 | ||||
-rw-r--r-- | src/conda.c | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/conda.h b/include/conda.h index cea3f02..d439371 100644 --- a/include/conda.h +++ b/include/conda.h @@ -89,7 +89,7 @@ int conda_activate(const char *root, const char *env_name); /** * Configure the active conda installation for headless operation */ -void conda_setup_headless(); +int conda_setup_headless(); /** * Creates a Conda environment from a YAML config diff --git a/src/conda.c b/src/conda.c index 976bbbc..2a7694e 100644 --- a/src/conda.c +++ b/src/conda.c @@ -249,7 +249,7 @@ int conda_check_required() { return 0; } -void conda_setup_headless() { +int conda_setup_headless() { if (globals.verbose) { conda_exec("config --system --set quiet false"); } else { @@ -285,7 +285,7 @@ void conda_setup_headless() { if (conda_exec(cmd)) { msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Unable to install user-defined base packages (conda)\n"); - exit(1); + return 1; } } @@ -307,7 +307,7 @@ void conda_setup_headless() { if (pip_exec(cmd)) { msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Unable to install user-defined base packages (pip)\n"); - exit(1); + return 1; } } @@ -315,15 +315,17 @@ void conda_setup_headless() { msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Your STASIS configuration lacks the bare" " minimum software required to build conda packages." " Please fix it.\n"); - exit(1); + return 1; } if (globals.always_update_base_environment) { if (conda_exec("update --all")) { fprintf(stderr, "conda update was unsuccessful\n"); - exit(1); + return 1; } } + + return 0; } int conda_env_create_from_uri(char *name, char *uri) { |