Skip to content

Commit

Permalink
REBASE use_chunkifier ?
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva committed Dec 22, 2023
1 parent c0e4bec commit 1923dba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tar/multitape/multitape_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ static int flushtape(TAPE_W *, int);
/* Initialize stream. */
static int
stream_init(struct stream * S, chunkify_callback callback, void * cookie,
int no_chunkifier)
int use_chunkifier)
{

/* Create chunkifier. */
if (!no_chunkifier) {
if (use_chunkifier) {
if ((S->c = chunkify_init(MEANCHUNK, MAXCHUNK, callback,
cookie)) == NULL)
goto err0;
Expand Down Expand Up @@ -416,13 +416,13 @@ writetape_open(uint64_t machinenum, const char * cachedir,
struct multitape_write_internal * d;
uint8_t lastseq[32];
size_t argvlen;
int no_chunkifiers;
int use_chunkifiers;

/* Sanity check options. */
assert(!((dryrun == 2) && printstats));

/* We want to the chunkifier in this case. */
no_chunkifiers = (dryrun == 2);
use_chunkifiers = (dryrun != 2);

/* Allocate memory. */
if ((d = malloc(sizeof(struct multitape_write_internal))) == NULL)
Expand Down Expand Up @@ -509,19 +509,19 @@ writetape_open(uint64_t machinenum, const char * cachedir,
goto err6;

/* Initialize streams. */
if (stream_init(&d->h, &callback_h, (void *)d, no_chunkifiers))
if (stream_init(&d->h, &callback_h, (void *)d, use_chunkifiers))
goto err6;
if (stream_init(&d->c, &callback_c, (void *)d, no_chunkifiers))
if (stream_init(&d->c, &callback_c, (void *)d, use_chunkifiers))
goto err7;
if (stream_init(&d->t, &callback_t, (void *)d, no_chunkifiers))
if (stream_init(&d->t, &callback_t, (void *)d, use_chunkifiers))
goto err8;

/* Initialize header buffer. */
if ((d->hbuf = bytebuf_init(0)) == NULL)
goto err9;

/* Initialize file chunkifier. */
if (!no_chunkifiers) {
if (use_chunkifiers) {
if ((d->c_file = chunkify_init(MEANCHUNK, MAXCHUNK,
&callback_file, (void *)d)) == NULL)
goto err10;
Expand Down

0 comments on commit 1923dba

Please sign in to comment.