summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic/slbt_exec_link.c')
-rw-r--r--src/logic/slbt_exec_link.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index b2cad03..122e6ee 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1244,9 +1244,15 @@ static int slbt_exec_link_create_import_library(
return SLBT_NESTED_ERROR(dctx);
/* dlltool/mdso spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return SLBT_SPAWN_ERROR(dctx);
+ } else if (ectx->exitcode) {
+ return SLBT_CUSTOM_ERROR(
+ dctx,
+ fmdso ? SLBT_ERR_MDSO_ERROR : SLBT_ERR_DLLTOOL_ERROR);
+ }
+
return 0;
}
@@ -1349,9 +1355,15 @@ static int slbt_exec_link_create_archive(
return SLBT_NESTED_ERROR(dctx);
/* ar spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return SLBT_SPAWN_ERROR(dctx);
+ } else if (ectx->exitcode) {
+ return SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_AR_ERROR);
+ }
+
/* input objects associated with .la archives */
for (parg=ectx->cargv; *parg; parg++)
if (slbt_adjust_wrapper_argument(*parg,true))
@@ -1566,11 +1578,19 @@ static int slbt_exec_link_create_library(
SLBT_NESTED_ERROR(dctx));
/* spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return slbt_exec_link_exit(
&depsmeta,
SLBT_SPAWN_ERROR(dctx));
+ } else if (ectx->exitcode) {
+ return slbt_exec_link_exit(
+ &depsmeta,
+ SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_LINK_ERROR));
+ }
+
return slbt_exec_link_exit(&depsmeta,0);
}
@@ -1739,11 +1759,19 @@ static int slbt_exec_link_create_executable(
SLBT_NESTED_ERROR(dctx));
/* spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return slbt_exec_link_exit(
&depsmeta,
SLBT_SPAWN_ERROR(dctx));
+ } else if (ectx->exitcode) {
+ return slbt_exec_link_exit(
+ &depsmeta,
+ SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_LINK_ERROR));
+ }
+
/* executable wrapper: finalize */
slbt_exec_close_fdwrapper(ectx);