From 285481de41269955229e931b92f8916783d11482 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 3 Aug 2018 23:33:04 +0000 Subject: library: removed mdso_create_driver_ctx() [too much of a good thing]. --- include/mdso/mdso.h | 4 ---- src/driver/mdso_driver_ctx.c | 51 -------------------------------------------- 2 files changed, 55 deletions(-) diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h index f8228e5..a2cdd57 100644 --- a/include/mdso/mdso.h +++ b/include/mdso/mdso.h @@ -143,10 +143,6 @@ mdso_api int mdso_get_driver_ctx (char ** argv, char ** envp, uint32_t fl const struct mdso_fd_ctx *, struct mdso_driver_ctx **); -mdso_api int mdso_create_driver_ctx (const struct mdso_common_ctx *, - const struct mdso_fd_ctx *, - struct mdso_driver_ctx **); - mdso_api void mdso_free_driver_ctx (struct mdso_driver_ctx *); mdso_api int mdso_get_unit_ctx (const struct mdso_driver_ctx *, const char * path, diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c index 2e7ddd9..f85ee80 100644 --- a/src/driver/mdso_driver_ctx.c +++ b/src/driver/mdso_driver_ctx.c @@ -356,57 +356,6 @@ int mdso_get_driver_ctx( return MDSO_OK; } -int mdso_create_driver_ctx( - const struct mdso_common_ctx * cctx, - const struct mdso_fd_ctx * fdctx, - struct mdso_driver_ctx ** pctx) -{ - int fddst; - struct argv_meta * meta; - struct mdso_driver_ctx_impl * ctx; - const struct argv_option * optv[MDSO_OPTV_ELEMENTS]; - char * argv[] = {"mdso_driver",0}; - - if (!fdctx) { - fdctx = &(const struct mdso_fd_ctx) { - .fdin = STDIN_FILENO, - .fdout = STDOUT_FILENO, - .fderr = STDERR_FILENO, - .fdlog = (-1), - .fdcwd = AT_FDCWD, - .fddst = AT_FDCWD, - }; - } - - argv_optv_init(mdso_default_options,optv); - - if (!(meta = argv_get(argv,optv,0,fdctx->fderr))) - return -1; - - if (!cctx->dstdir && !(cctx->drvflags & MDSO_DRIVER_GENERATE_OBJECTS)) - fddst = AT_FDCWD; - - else if ((fddst = mdso_dstdir_open( - fdctx->fdcwd, - cctx->dstdir, - cctx->asmbase)) < 0) - return mdso_get_driver_ctx_fail(meta,0,0,AT_FDCWD); - - if (!(ctx = mdso_driver_ctx_alloc(meta,fdctx,cctx,0))) - return mdso_get_driver_ctx_fail(meta,0,0,fddst); - - if (!ctx->cctx.dsoflags) - ctx->cctx.dsoflags = MDSO_FLAG_LOADER_PATH; - - ctx->fddst = fddst; - ctx->ctx.cctx = &ctx->cctx; - ctx->fdctx.fddst = fddst; - - *pctx = &ctx->ctx; - - return MDSO_OK; -} - static void mdso_free_driver_ctx_impl(struct mdso_driver_ctx_alloc * ictx) { if (ictx->ctx.fddst != AT_FDCWD) -- cgit v1.2.3