Skip to content

Commit 2c99cd3

Browse files
committed
Remove unused function and simplify
This was also causing compiler warnings (bool being incremented).
1 parent 5725929 commit 2c99cd3

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

downloader.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ struct download {
9191
char *obuf; /* pre-write buffer */
9292
size_t obufsz; /* current size of obuf */
9393
size_t obufmax; /* max size we'll wbuffer */
94-
bool needredo; /* needs redo phase */
9594
size_t curtok; /* current token (compression) */
9695
off_t fdpos; /* current pre-buffer position in file */
9796
};
@@ -123,7 +122,6 @@ download_reinit(struct sess *sess, struct download *p, size_t idx)
123122
/* Don't touch p->fdin. */
124123
/* Don't touch p->obufsz. */
125124
/* Don't touch p->obufmax. */
126-
/* Don't touch p->needredo. */
127125
p->curtok = 0;
128126
p->fdpos = 0;
129127
MD4_Update(&p->ctx, &seed, sizeof(int32_t));
@@ -292,7 +290,6 @@ download_alloc(struct sess *sess, int fdin, struct flist *fl,
292290
p->flsz = flsz;
293291
p->rootfd = rootfd;
294292
p->fdin = fdin;
295-
p->needredo = false;
296293
download_reinit(sess, p, 0);
297294
p->obufsz = 0;
298295
p->obuf = NULL;
@@ -305,12 +302,6 @@ download_alloc(struct sess *sess, int fdin, struct flist *fl,
305302
return p;
306303
}
307304

308-
bool
309-
download_needs_redo(const struct download *p)
310-
{
311-
return p->needredo;
312-
}
313-
314305
/*
315306
* Perform all cleanups (including removing stray files) and free.
316307
* Passing a NULL to this function is ok.
@@ -705,7 +696,7 @@ protocol_token_ff_compress(struct sess *sess, struct download *p,
705696
* and trigger redo.
706697
*/
707698
WARNX1("%s: block at %lld outside of local file sized %zu",
708-
p->fname, off, fmap_size(p->map));
699+
p->fname, (long long int)off, fmap_size(p->map));
709700
p->state = DOWNLOAD_FLUSH_REMOTE;
710701
return TOKEN_NEXT;
711702
} else if (!fmap_trap(p->map)) {
@@ -824,7 +815,7 @@ protocol_token_ff(struct sess *sess, struct download *p, size_t tok)
824815
* and trigger redo.
825816
*/
826817
WARNX1("%s: block at %lld outside of local file sized %zu",
827-
p->fname, off, fmap_size(p->map));
818+
p->fname, (long long int)off, fmap_size(p->map));
828819
p->state = DOWNLOAD_FLUSH_REMOTE;
829820
return TOKEN_NEXT;
830821
} else if (!fmap_trap(p->map)) {
@@ -1524,7 +1515,6 @@ rsync_downloader(struct download *p, struct sess *sess, int *ofd)
15241515
}
15251516

15261517
f->flstate |= FLIST_REDO;
1527-
p->needredo++;
15281518
goto done;
15291519
}
15301520

extern.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ int rsync_uploader(struct upload *, struct sess *, int, int *, int *,
759759
const struct hardlinks *const);
760760
bool rsync_uploader_tail(struct upload *, struct sess *);
761761

762-
bool download_needs_redo(const struct download *);
763762
const char *download_partial_filepath(const struct flist *);
764763
struct download *download_alloc(struct sess *, int, struct flist *,
765764
size_t, int);

receiver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,7 @@ rsync_receiver(struct sess *sess, int fdin, int fdout, const char *root)
906906
make_hardlinks(sess, fl, flsz, &hls, dfd);
907907

908908
LOG3("%s: receiver ready for phase %d "
909-
"data (%d to redo)", root,
910-
phase + 1, 0);
909+
"data", root, phase + 1);
911910

912911
sess->role->append = false;
913912

0 commit comments

Comments
 (0)