summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-09-03 04:23:22 -0400
committermidipix <writeonce@midipix.org>2016-09-03 23:23:24 -0400
commit8a1d14646afb1a62f18edd9f85f61dfba48dcf31 (patch)
tree05ed081849ca8be9800bd2a6ca89e86a39251dba
parentd56ead6e8bf4e3921639033e6bec35f3589ee0c4 (diff)
downloadslibtool-8a1d14646afb1a62f18edd9f85f61dfba48dcf31.tar.bz2
slibtool-8a1d14646afb1a62f18edd9f85f61dfba48dcf31.tar.xz
slbt_archive_import(): added error trace support.
-rw-r--r--src/helper/slbt_archive_import.c14
1 files 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 <slibtool/slibtool.h>
#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;
}