diff options
author | midipix <writeonce@midipix.org> | 2024-02-04 03:07:33 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-04 03:07:33 +0000 |
commit | 63953420efc0b8f686bfba75572365be10bbaa1f (patch) | |
tree | 091772ae3d420106847bb9c1109caf4eb0a10861 | |
parent | 65cb3577471064252dcb2cbeec0683c54c6da09d (diff) | |
download | slibtool-63953420efc0b8f686bfba75572365be10bbaa1f.tar.bz2 slibtool-63953420efc0b8f686bfba75572365be10bbaa1f.tar.xz |
slbt_exec_compile(): fix logging of compiler errors.
-rw-r--r-- | include/slibtool/slibtool.h | 1 | ||||
-rw-r--r-- | src/logic/slbt_exec_compile.c | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h index e2e1f43..4267665 100644 --- a/include/slibtool/slibtool.h +++ b/include/slibtool/slibtool.h @@ -87,6 +87,7 @@ extern "C" { enum slbt_custom_error { SLBT_ERR_FLOW_ERROR, SLBT_ERR_FLEE_ERROR, + SLBT_ERR_COMPILE_ERROR, SLBT_ERR_ARCHIVE_IMPORT, SLBT_ERR_HOST_INIT, SLBT_ERR_INSTALL_FAIL, diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c index f9cd1d2..16c8332 100644 --- a/src/logic/slbt_exec_compile.c +++ b/src/logic/slbt_exec_compile.c @@ -204,9 +204,13 @@ int slbt_exec_compile( } } - if (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode) { + if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) { slbt_free_exec_ctx(actx); return SLBT_SYSTEM_ERROR(dctx,0); + + } else if (ectx->exitcode) { + slbt_free_exec_ctx(actx); + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_COMPILE_ERROR); } if (cctx->drvflags & SLBT_DRIVER_STATIC) @@ -235,9 +239,13 @@ int slbt_exec_compile( } } - if (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode) { + if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) { slbt_free_exec_ctx(actx); return SLBT_SYSTEM_ERROR(dctx,0); + + } else if (ectx->exitcode) { + slbt_free_exec_ctx(actx); + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_COMPILE_ERROR); } } |