From 8a1d14646afb1a62f18edd9f85f61dfba48dcf31 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 3 Sep 2016 04:23:22 -0400 Subject: slbt_archive_import(): added error trace support. --- src/helper/slbt_archive_import.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c index 1d1d5e1..da13a99 100644 --- a/src/helper/slbt_archive_import.c +++ b/src/helper/slbt_archive_import.c @@ -14,6 +14,7 @@ #include #include "slibtool_spawn_impl.h" +#include "slibtool_errinfo_impl.h" static char * slbt_mri_argument( char * arg, @@ -90,15 +91,15 @@ int slbt_archive_import( if ((size_t)snprintf(program,sizeof(program),"%s", dctx->cctx->host.ar) >= sizeof(program)) - return -1; + return SLBT_BUFFER_ERROR(dctx); if (pipe(fd)) - return -1; + return SLBT_SYSTEM_ERROR(dctx); if ((pid = fork()) < 0) { close(fd[0]); close(fd[1]); - return -1; + return SLBT_SYSTEM_ERROR(dctx); } if (pid == 0) @@ -120,12 +121,13 @@ int slbt_archive_import( "END\n", dst, src) < 0) - ? -1 : 0; + ? SLBT_SYSTEM_ERROR(dctx) + : 0; fclose(fout); close(fd[0]); } else { - ret = -1; + ret = SLBT_SYSTEM_ERROR(dctx); close(fd[0]); close(fd[1]); } @@ -142,5 +144,5 @@ int slbt_archive_import( unlink(src); return ret || (rpid != pid) || ectx->exitcode - ? -1 : 0; + ? SLBT_CUSTOM_ERROR(dctx,0) : 0; } -- cgit v1.2.3