diff options
author | midipix <writeonce@midipix.org> | 2024-07-18 04:20:56 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-07-18 05:08:24 +0000 |
commit | 88391942aae898d9d7b58bb130dccef44d57634c (patch) | |
tree | f2701f967c12abcbbbf7fd4da97614c26028f950 | |
parent | df2d16faa681af8770e63c5e3f9307ba12bd9685 (diff) | |
download | tpax-88391942aae898d9d7b58bb130dccef44d57634c.tar.bz2 tpax-88391942aae898d9d7b58bb130dccef44d57634c.tar.xz |
driver: tpax_driver_ctx_alloc(): allocate the file i/o buffer for all modes.
-rw-r--r-- | src/driver/tpax_driver_ctx.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c index 4ad7fe6..d926631 100644 --- a/src/driver/tpax_driver_ctx.c +++ b/src/driver/tpax_driver_ctx.c @@ -504,20 +504,20 @@ static struct tpax_driver_ctx_impl * tpax_driver_ctx_alloc( for (keyval=entry->keyv; keyval->keyword; keyval++) *pkeyval++ = keyval; - if (cctx->drvflags & TPAX_DRIVER_EXEC_MODE_WRITE_COPY) { - ictx->ctx.bufsize = TPAX_FILEIO_BUFLEN; - ictx->ctx.bufaddr = mmap( - 0,ictx->ctx.bufsize, - PROT_READ|PROT_WRITE, - MAP_PRIVATE|MAP_ANONYMOUS, - -1,0); - - if (ictx->ctx.bufaddr == MAP_FAILED) { - free(ictx->ctx.keyvalv); - free(ictx); - return 0; - } + ictx->ctx.bufsize = TPAX_FILEIO_BUFLEN; + ictx->ctx.bufaddr = mmap( + 0,ictx->ctx.bufsize, + PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1,0); + + if (ictx->ctx.bufaddr == MAP_FAILED) { + free(ictx->ctx.keyvalv); + free(ictx); + return 0; + } + if (cctx->drvflags & TPAX_DRIVER_EXEC_MODE_WRITE_COPY) { ictx->ctx.dirbuff = mmap( 0,TPAX_DIRENT_BUFLEN, PROT_READ|PROT_WRITE, |