diff options
author | midipix <writeonce@midipix.org> | 2018-08-03 23:33:04 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-08-03 21:13:31 -0400 |
commit | 285481de41269955229e931b92f8916783d11482 (patch) | |
tree | b00ad1dfe572dd83519ad894cbbce4f0ae805196 | |
parent | 9695ec6ea64c668211f0e39691e87419c1c0b424 (diff) | |
download | mdso-285481de41269955229e931b92f8916783d11482.tar.bz2 mdso-285481de41269955229e931b92f8916783d11482.tar.xz |
library: removed mdso_create_driver_ctx() [too much of a good thing].
-rw-r--r-- | include/mdso/mdso.h | 4 | ||||
-rw-r--r-- | src/driver/mdso_driver_ctx.c | 51 |
2 files changed, 0 insertions, 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) |