From ec6c65d45c38a8927efb4e36af0dfff879f46b32 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 3 Aug 2018 22:09:51 +0000 Subject: driver: object file generation: create in a lib-specific folder (same as asm). --- src/driver/mdso_driver_ctx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c index 562968d..2e7ddd9 100644 --- a/src/driver/mdso_driver_ctx.c +++ b/src/driver/mdso_driver_ctx.c @@ -118,7 +118,10 @@ static int mdso_dstdir_open(int fdcwd, const char * dstdir, const char * asmbase int fddst; int dirmode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; - if ((fdtop = openat(fdcwd,dstdir,O_DIRECTORY)) >= 0) + if (!dstdir) + fdtop = fdcwd; + + else if ((fdtop = openat(fdcwd,dstdir,O_DIRECTORY)) >= 0) (void)0; else if (mkdirat(fdcwd,dstdir,dirmode) < 0) @@ -329,7 +332,7 @@ int mdso_get_driver_ctx( *dot = '\0'; - if (!cctx.dstdir) + if (!cctx.dstdir && !(cctx.drvflags & MDSO_DRIVER_GENERATE_OBJECTS)) fddst = AT_FDCWD; else if ((fddst = mdso_dstdir_open(fdctx->fdcwd,cctx.dstdir,asmbase)) < 0) @@ -380,7 +383,7 @@ int mdso_create_driver_ctx( if (!(meta = argv_get(argv,optv,0,fdctx->fderr))) return -1; - if (!cctx->dstdir) + if (!cctx->dstdir && !(cctx->drvflags & MDSO_DRIVER_GENERATE_OBJECTS)) fddst = AT_FDCWD; else if ((fddst = mdso_dstdir_open( -- cgit v1.2.3