summaryrefslogtreecommitdiffstats
path: root/usr.bin/rsync/sender.c
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2019-02-21 22:08:53 +0000
committerbenno <benno@openbsd.org>2019-02-21 22:08:53 +0000
commit021bd7eed5eeaf3b9fc0595a0adf53ad8db0de4a (patch)
tree51cff4db163cae9a939e5a071bfc36702691ea90 /usr.bin/rsync/sender.c
parentkristaps acb8f263717f27691f0318d4b7154f854b7206b3 (diff)
downloadwireguard-openbsd-021bd7eed5eeaf3b9fc0595a0adf53ad8db0de4a.tar.xz
wireguard-openbsd-021bd7eed5eeaf3b9fc0595a0adf53ad8db0de4a.zip
kristaps b1c688cad9f544a59b871c9984888cb1a3ae11e4
Avoid crash when -n is specified.
Diffstat (limited to 'usr.bin/rsync/sender.c')
-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);