summaryrefslogtreecommitdiffhomepage
path: root/src/logic/slbt_exec_install.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic/slbt_exec_install.c')
-rw-r--r--src/logic/slbt_exec_install.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index d643cae..0f4f38e 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -324,7 +324,6 @@ static int slbt_exec_install_entry(
char ** src,
char ** dst)
{
- int ret;
int fdcwd;
const char * base;
char * dot;
@@ -399,8 +398,16 @@ static int slbt_exec_install_entry(
if (slbt_output_install(dctx,ectx))
return SLBT_NESTED_ERROR(dctx);
- return (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode)
- ? SLBT_SPAWN_ERROR(dctx) : 0;
+ 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_INSTALL_ERROR);
+ }
+
+ return 0;
}
/* -shrext, dsosuffix */
@@ -580,9 +587,15 @@ static int slbt_exec_install_entry(
if (slbt_output_install(dctx,ectx))
return SLBT_NESTED_ERROR(dctx);
- if (((ret = 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_INSTALL_ERROR);
+ }
+
return 0;
}
@@ -604,9 +617,15 @@ static int slbt_exec_install_entry(
if (slbt_output_install(dctx,ectx))
return SLBT_NESTED_ERROR(dctx);
- if (((ret = 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_INSTALL_ERROR);
+ }
+
/* destination symlink: dstdir/libfoo.so */
if ((size_t)snprintf(dlnkname,sizeof(dlnkname),"%s/%s",
dstdir,base) >= sizeof(dlnkname))
@@ -883,10 +902,18 @@ int slbt_exec_install(
if (slbt_output_install(dctx,ectx))
return SLBT_NESTED_ERROR(dctx);
- if (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return slbt_exec_install_fail(
actx,meta,
SLBT_SPAWN_ERROR(dctx));
+
+ } else if (ectx->exitcode) {
+ return slbt_exec_install_fail(
+ actx,meta,
+ SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_INSTALL_ERROR));
+ }
}
argv_free(meta);