mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-04-06 17:49:11 +03:00
libzfs_sendrecv: Pull header line out of loop
This makes the header print before the sleep as well, which is fine. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes #12967
This commit is contained in:
parent
24f1aa023a
commit
fbcc25c9b2
@ -908,13 +908,20 @@ send_progress_thread(void *arg)
|
|||||||
char buf[16];
|
char buf[16];
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
boolean_t firstloop = B_TRUE;
|
int err;
|
||||||
|
|
||||||
|
if (!pa->pa_parsable) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"TIME %s %sSNAPSHOT %s\n",
|
||||||
|
pa->pa_estimate ? "BYTES" : " SENT",
|
||||||
|
pa->pa_verbosity >= 2 ? " BLOCKS " : "",
|
||||||
|
zhp->zfs_name);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print the progress from ZFS_IOC_SEND_PROGRESS every second.
|
* Print the progress from ZFS_IOC_SEND_PROGRESS every second.
|
||||||
*/
|
*/
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int err;
|
|
||||||
(void) sleep(1);
|
(void) sleep(1);
|
||||||
if ((err = zfs_send_progress(zhp, pa->pa_fd, &bytes,
|
if ((err = zfs_send_progress(zhp, pa->pa_fd, &bytes,
|
||||||
&blocks)) != 0) {
|
&blocks)) != 0) {
|
||||||
@ -923,15 +930,6 @@ send_progress_thread(void *arg)
|
|||||||
return ((void *)(uintptr_t)err);
|
return ((void *)(uintptr_t)err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstloop && !pa->pa_parsable) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
"TIME %s %sSNAPSHOT %s\n",
|
|
||||||
pa->pa_estimate ? "BYTES" : " SENT",
|
|
||||||
pa->pa_verbosity >= 2 ? " BLOCKS " : "",
|
|
||||||
zhp->zfs_name);
|
|
||||||
firstloop = B_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
(void) time(&t);
|
(void) time(&t);
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user