diff options
author | midipix <writeonce@midipix.org> | 2024-02-04 04:04:29 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-04 04:04:29 +0000 |
commit | fcfea7a7220dcd73e945197079c7bd8d67a4cade (patch) | |
tree | 027eb6b0dd11f8ef06a8131ef2e844d07863c54d | |
parent | 3056ff4e8dd7e01aefca2f11c586997efd1a2588 (diff) | |
download | slibtool-fcfea7a7220dcd73e945197079c7bd8d67a4cade.tar.bz2 slibtool-fcfea7a7220dcd73e945197079c7bd8d67a4cade.tar.xz |
slbt_copy_file(): enhance logging of copy errors.
-rw-r--r-- | include/slibtool/slibtool.h | 1 | ||||
-rw-r--r-- | src/helper/slbt_copy_file.c | 14 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h index d30c2dc..8e80811 100644 --- a/include/slibtool/slibtool.h +++ b/include/slibtool/slibtool.h @@ -91,6 +91,7 @@ enum slbt_custom_error { SLBT_ERR_LINK_ERROR, SLBT_ERR_INSTALL_ERROR, SLBT_ERR_AR_ERROR, + SLBT_ERR_COPY_ERROR, SLBT_ERR_MDSO_ERROR, SLBT_ERR_DLLTOOL_ERROR, SLBT_ERR_ARCHIVE_IMPORT, diff --git a/src/helper/slbt_copy_file.c b/src/helper/slbt_copy_file.c index 04e4893..2cfb042 100644 --- a/src/helper/slbt_copy_file.c +++ b/src/helper/slbt_copy_file.c @@ -58,9 +58,17 @@ int slbt_copy_file( } } - /* dlltool spawn */ - ret = ((slbt_spawn(ectx,true) < 0) || ectx->exitcode) - ? SLBT_SYSTEM_ERROR(dctx,0) : 0; + /* cp spawn */ + if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) { + ret = SLBT_SPAWN_ERROR(dctx); + + } else if (ectx->exitcode) { + ret = SLBT_CUSTOM_ERROR( + dctx, + SLBT_ERR_COPY_ERROR); + } else { + ret = 0; + } ectx->argv = oargv; ectx->program = oprogram; |