summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authorKylie McClain <kylie@somasis.com>2016-11-01 22:48:45 -0400
committermidipix <writeonce@midipix.org>2016-11-01 23:53:05 -0400
commit7ce25c2d6605d10466a9e8d8742fe1ed5e231709 (patch)
tree65172148197a052f12b4be4ec2996a650d7d2e7d /src/logic
parent4a7f9941e0b15da74e7ff81a4092169396ae8f61 (diff)
downloadslibtool-7ce25c2d6605d10466a9e8d8742fe1ed5e231709.tar.bz2
slibtool-7ce25c2d6605d10466a9e8d8742fe1ed5e231709.tar.xz
error trace: use descriptive errcodes for invocations of SLBT_CUSTOM_ERROR.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_install.c26
-rw-r--r--src/logic/slbt_exec_link.c6
-rw-r--r--src/logic/slbt_exec_uninstall.c2
3 files changed, 17 insertions, 17 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index 75fb263..b5c1587 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -117,7 +117,7 @@ static int slbt_exec_install_import_libraries(
/* (dso is under .libs) */
if (!(slash = strrchr(srcbuf,'/')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
/* libfoo.so.x.y.z */
if ((size_t)snprintf(implib,sizeof(implib),"%s",
@@ -125,14 +125,14 @@ static int slbt_exec_install_import_libraries(
- strlen(dctx->cctx->settings.impsuffix))
return SLBT_BUFFER_ERROR(dctx);
- /* guard againt an infinitely long version */
+ /* guard against an infinitely long version */
mark = srcbuf + strlen(srcbuf);
/* rev */
if (!(dot = strrchr(srcbuf,'.')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
else if ((size_t)(mark - dot) > sizeof(rev))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_REV);
else {
strcpy(rev,dot);
*dot = 0;
@@ -140,9 +140,9 @@ static int slbt_exec_install_import_libraries(
/* minor */
if (!(dot = strrchr(srcbuf,'.')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
else if ((size_t)(mark - dot) > sizeof(minor))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_REV);
else {
strcpy(minor,dot);
*dot = 0;
@@ -150,16 +150,16 @@ static int slbt_exec_install_import_libraries(
/* major */
if (!(dot = strrchr(srcbuf,'.')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
else if ((size_t)(mark - dot) > sizeof(major))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_REV);
else {
strcpy(major,dot);
*dot = 0;
}
if (!(dot = strrchr(srcbuf,'.')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
/* .libs/libfoo.so.def.host */
if ((size_t)snprintf(hostlnk,sizeof(hostlnk),"%s.def.host",
@@ -172,7 +172,7 @@ static int slbt_exec_install_import_libraries(
/* host/flabor */
if (!(host = strrchr(hosttag,'.')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
else
host++;
@@ -491,12 +491,12 @@ static int slbt_exec_install_entry(
if ((dot = strrchr(slnkname,'.')))
*dot = 0;
else
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
if ((dot = strrchr(slnkname,'.')))
*dot = 0;
else
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
/* destination symlink: dstdir/libfoo.so.x */
if ((size_t)snprintf(dlnkname,sizeof(dlnkname),"%s/%s",
@@ -581,7 +581,7 @@ int slbt_exec_install(
: ARGV_VERBOSITY_NONE)))
return slbt_exec_install_fail(
actx,meta,
- SLBT_CUSTOM_ERROR(dctx,0));
+ SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FAIL));
/* dest, alternate argument vector options */
argv = ectx->altv;
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index bd29ee0..6e3268d 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -479,7 +479,7 @@ static int slbt_exec_link_adjust_argument_vector(
} else if (freqd) {
free(depsmeta->altv);
free(depsmeta->args);
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_LINK_FREQ);
}
}
}
@@ -719,7 +719,7 @@ static int slbt_exec_link_create_import_library(
/* libfoo.so.def is under .libs/ */
if (!(slash = strrchr(deffilename,'/')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_LINK_FLOW);
if (slbt_create_symlink(
dctx,ectx,
@@ -730,7 +730,7 @@ static int slbt_exec_link_create_import_library(
/* libfoo.so.def.{flavor} is under .libs/ */
if (!(slash = strrchr(hosttag,'/')))
- return SLBT_CUSTOM_ERROR(dctx,0);
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_LINK_FLOW);
if (slbt_create_symlink(
dctx,ectx,
diff --git a/src/logic/slbt_exec_uninstall.c b/src/logic/slbt_exec_uninstall.c
index 2e54f79..cc27911 100644
--- a/src/logic/slbt_exec_uninstall.c
+++ b/src/logic/slbt_exec_uninstall.c
@@ -286,7 +286,7 @@ int slbt_exec_uninstall(
: ARGV_VERBOSITY_NONE)))
return slbt_exec_uninstall_fail(
actx,meta,
- SLBT_CUSTOM_ERROR(dctx,0));
+ SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_UNINSTALL_FAIL));
/* dest, alternate argument vector options */
argv = ectx->altv;