summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_compile.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-09-02 15:33:01 -0400
committermidipix <writeonce@midipix.org>2016-09-03 23:23:32 -0400
commit9149bce21bae5daf7d643ed843280751914e6707 (patch)
tree036e8d439d5aaa035d7ceee853c0e5e6869b8d24 /src/logic/slbt_exec_compile.c
parent2a6c451dc80e84e0948dfbec73e54fb09426c867 (diff)
downloadslibtool-9149bce21bae5daf7d643ed843280751914e6707.tar.bz2
slibtool-9149bce21bae5daf7d643ed843280751914e6707.tar.xz
compile mode: added error trace support.
Diffstat (limited to 'src/logic/slbt_exec_compile.c')
-rw-r--r--src/logic/slbt_exec_compile.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c
index 90df731..80363cc 100644
--- a/src/logic/slbt_exec_compile.c
+++ b/src/logic/slbt_exec_compile.c
@@ -13,6 +13,7 @@
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
#include "slibtool_mkdir_impl.h"
+#include "slibtool_errinfo_impl.h"
#include "slibtool_metafile_impl.h"
static int slbt_exec_compile_remove_file(
@@ -29,7 +30,7 @@ static int slbt_exec_compile_remove_file(
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT))
strerror(errno);
- return -1;
+ return SLBT_SYSTEM_ERROR(dctx);
}
int slbt_exec_compile(
@@ -53,13 +54,13 @@ int slbt_exec_compile(
/* remove old .lo wrapper */
if (slbt_exec_compile_remove_file(dctx,ectx,ectx->ltobjname))
- return -1;
+ return SLBT_NESTED_ERROR(dctx);
/* .libs directory */
if (dctx->cctx->drvflags & SLBT_DRIVER_SHARED)
if (slbt_mkdir(ectx->ldirname)) {
slbt_free_exec_ctx(actx);
- return -1;
+ return SLBT_SYSTEM_ERROR(dctx);
}
/* compile mode */
@@ -88,13 +89,13 @@ int slbt_exec_compile(
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) {
if (slbt_output_compile(dctx,ectx)) {
slbt_free_exec_ctx(actx);
- return -1;
+ return SLBT_NESTED_ERROR(dctx);
}
}
if (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode) {
slbt_free_exec_ctx(actx);
- return -1;
+ return SLBT_SYSTEM_ERROR(dctx);
}
}
@@ -122,18 +123,18 @@ int slbt_exec_compile(
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) {
if (slbt_output_compile(dctx,ectx)) {
slbt_free_exec_ctx(actx);
- return -1;
+ return SLBT_NESTED_ERROR(dctx);
}
}
if (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode) {
slbt_free_exec_ctx(actx);
- return -1;
+ return SLBT_SYSTEM_ERROR(dctx);
}
}
ret = slbt_create_object_wrapper(dctx,ectx);
slbt_free_exec_ctx(actx);
- return ret;
+ return ret ? SLBT_NESTED_ERROR(dctx) : 0;
}