summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2019-02-21 22:08:54 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2019-02-21 22:08:54 +0000
commit7e4d3eced613986f5efa2594185426ef94cec374 (patch)
tree5cc383584ef78ce13ad47dc47e0e3f9e66618425
parent762ea3dec65248f335e94fdb69c317c854684a1f (diff)
kristaps b1c688cad9f544a59b871c9984888cb1a3ae11e4
Avoid crash when -n is specified.
-rw-r--r--usr.bin/rsync/sender.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/rsync/sender.c b/usr.bin/rsync/sender.c
index 891ae783885..ad429e91c3a 100644
--- a/usr.bin/rsync/sender.c
+++ b/usr.bin/rsync/sender.c
@@ -1,4 +1,4 @@
-/* $Id: sender.c,v 1.16 2019/02/18 22:47:34 benno Exp $ */
+/* $Id: sender.c,v 1.17 2019/02/21 22:08:53 benno Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -174,10 +174,11 @@ send_up_fsm(struct sess *sess, size_t *phase,
* to find another.
*/
- LOG3(sess, "%s: flushed %jd KB total, %.2f%% uploaded",
- fl[up->cur->idx].path,
- (intmax_t)up->stat.total / 1024,
- 100.0 * up->stat.dirty / up->stat.total);
+ if (!sess->opts->dry_run)
+ LOG3(sess, "%s: flushed %jd KB total, %.2f%% "
+ "uploaded", fl[up->cur->idx].path,
+ (intmax_t)up->stat.total / 1024,
+ 100.0 * up->stat.dirty / up->stat.total);
send_up_reset(up);
return 1;
case BLKSTAT_PHASE:
@@ -241,7 +242,7 @@ send_up_fsm(struct sess *sess, size_t *phase,
return 0;
}
io_lowbuffer_int(sess, *wb, &pos, *wbsz, up->cur->idx);
- up->stat.curst = BLKSTAT_NEXT;
+ up->stat.curst = BLKSTAT_DONE;
} else {
assert(up->stat.fd != -1);