diff options
Diffstat (limited to 'src/logic/tpax_archive_append.c')
-rw-r--r-- | src/logic/tpax_archive_append.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/logic/tpax_archive_append.c b/src/logic/tpax_archive_append.c index 4b81cb1..ef011fd 100644 --- a/src/logic/tpax_archive_append.c +++ b/src/logic/tpax_archive_append.c @@ -166,7 +166,6 @@ static int tpax_archive_append_one( const char * src; char * dst; char pbuf[1024]; - char sbuf[2048]; /* fake uctx for recursion items */ unit = 0; @@ -254,12 +253,11 @@ static int tpax_archive_append_one( /* associated data? */ if S_ISREG(uctx->st->st_mode) { - if ((buf = tpax_get_driver_anon_map_addr(dctx,&buflen))) - if (buflen >= (cmplen = uctx->st->st_size)) - membuf = buf; + buf = tpax_get_driver_anon_map_addr( + dctx,&buflen); - if (ssizeof(sbuf) >= (uctx->st->st_size)) - membuf = sbuf; + if (buflen >= (cmplen = uctx->st->st_size)) + membuf = buf; /* snapshot */ if (membuf) { @@ -304,10 +302,8 @@ static int tpax_archive_append_one( /* append data from snapshot */ if (fdtmp >= 0) { - if (!buf) { - buf = sbuf; - buflen = sizeof(sbuf); - } + buf = tpax_get_driver_anon_map_addr( + dctx,&buflen); for (nread=0; nread<uctx->st->st_size; ) { nbytes = read(fdtmp,buf,buflen); |