diff options
-rw-r--r-- | include/slibtool/slibtool.h | 12 | ||||
-rw-r--r-- | src/driver/slbt_driver_ctx.c | 4 | ||||
-rw-r--r-- | src/helper/slbt_archive_import.c | 2 | ||||
-rw-r--r-- | src/logic/slbt_exec_install.c | 26 | ||||
-rw-r--r-- | src/logic/slbt_exec_link.c | 6 | ||||
-rw-r--r-- | src/logic/slbt_exec_uninstall.c | 2 |
6 files changed, 32 insertions, 20 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h index 812efd3..34e3364 100644 --- a/include/slibtool/slibtool.h +++ b/include/slibtool/slibtool.h @@ -25,6 +25,18 @@ extern "C" { #define SLBT_USAGE 0x01 #define SLBT_ERROR 0x02 +enum slbt_custom_error { + SLBT_ERR_ARCHIVE_IMPORT, + SLBT_ERR_HOST_INIT, + SLBT_ERR_INSTALL_FAIL, + SLBT_ERR_INSTALL_FLOW, + SLBT_ERR_INSTALL_REV, + SLBT_ERR_LDRPATH_INIT, + SLBT_ERR_LINK_FLOW, + SLBT_ERR_LINK_FREQ, + SLBT_ERR_UNINSTALL_FAIL, +}; + /* driver flags */ #define SLBT_DRIVER_VERBOSITY_NONE 0x0000 #define SLBT_DRIVER_VERBOSITY_ERRORS 0x0001 diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index 6b2cfaa..81a34ac 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -1199,7 +1199,7 @@ int slbt_set_alternate_host( &ictx->ctx.cctx.ahost, &ictx->ctx.cctx.acfgmeta)) { slbt_free_host_params(&ictx->ctx.ahost); - return SLBT_CUSTOM_ERROR(ctx,0); + return SLBT_CUSTOM_ERROR(ctx,SLBT_ERR_HOST_INIT); } slbt_init_flavor_settings( @@ -1211,7 +1211,7 @@ int slbt_set_alternate_host( &ictx->ctx.cctx, &ictx->ctx.cctx.ahost)) { slbt_free_host_params(&ictx->ctx.ahost); - return SLBT_CUSTOM_ERROR(ctx,0); + return SLBT_CUSTOM_ERROR(ctx,SLBT_ERR_LDRPATH_INIT); } return 0; diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c index da13a99..d43c112 100644 --- a/src/helper/slbt_archive_import.c +++ b/src/helper/slbt_archive_import.c @@ -144,5 +144,5 @@ int slbt_archive_import( unlink(src); return ret || (rpid != pid) || ectx->exitcode - ? SLBT_CUSTOM_ERROR(dctx,0) : 0; + ? SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_ARCHIVE_IMPORT) : 0; } 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; |