summaryrefslogtreecommitdiffhomepage
path: root/src/logic/slbt_exec_compile.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-03 12:42:43 -0400
committermidipix <writeonce@midipix.org>2016-05-03 12:42:43 -0400
commit3895afa953a49e842fa99fa08842268d6f58aae9 (patch)
tree11038948722193d6edf0207f2e4dbf8636c1e470 /src/logic/slbt_exec_compile.c
parent77a4b7c9b9108b8af21b3bb1ad5efb3249c55821 (diff)
downloadslibtool-3895afa953a49e842fa99fa08842268d6f58aae9.tar.bz2
slibtool-3895afa953a49e842fa99fa08842268d6f58aae9.tar.xz
internals: slbt_mkdir(): initial implementation and integration.
Diffstat (limited to 'src/logic/slbt_exec_compile.c')
-rw-r--r--src/logic/slbt_exec_compile.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c
index c5c3e70..4a75270 100644
--- a/src/logic/slbt_exec_compile.c
+++ b/src/logic/slbt_exec_compile.c
@@ -12,6 +12,7 @@
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
+#include "slibtool_mkdir_impl.h"
static int slbt_exec_compile_remove_file(
const struct slbt_driver_ctx * dctx,
@@ -35,7 +36,6 @@ int slbt_exec_compile(
struct slbt_exec_ctx * ectx)
{
int ret;
- int fdlibs;
FILE * fout;
struct slbt_exec_ctx * actx = 0;
const struct slbt_source_version * verinfo;
@@ -57,16 +57,11 @@ int slbt_exec_compile(
return -1;
/* .libs directory */
- if (dctx->cctx->drvflags & SLBT_DRIVER_SHARED) {
- if ((fdlibs = open(ectx->ldirname,O_DIRECTORY)) >= 0)
- close(fdlibs);
- else if ((errno != ENOENT) || mkdir(ectx->ldirname,0777)) {
- if (errno != EEXIST) {
- slbt_free_exec_ctx(actx);
- return -1;
- }
+ if (dctx->cctx->drvflags & SLBT_DRIVER_SHARED)
+ if (slbt_mkdir(ectx->ldirname)) {
+ slbt_free_exec_ctx(actx);
+ return -1;
}
- }
/* compile mode */
ectx->program = ectx->compiler;