From fcfea7a7220dcd73e945197079c7bd8d67a4cade Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 4 Feb 2024 04:04:29 +0000 Subject: slbt_copy_file(): enhance logging of copy errors. --- src/helper/slbt_copy_file.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/helper/slbt_copy_file.c') 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; -- cgit v1.2.3