Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zpool status: flush output before sleeping #15593

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5950,6 +5950,7 @@ zpool_do_iostat(int argc, char **argv)
print_iostat_header(&cb);

if (skip) {
(void) fflush(stdout);
(void) fsleep(interval);
continue;
}
Expand Down Expand Up @@ -5980,18 +5981,13 @@ zpool_do_iostat(int argc, char **argv)

}

/*
* Flush the output so that redirection to a file isn't buffered
* indefinitely.
*/
(void) fflush(stdout);

if (interval == 0)
break;

if (count != 0 && --count == 0)
break;

(void) fflush(stdout);
(void) fsleep(interval);
}

Expand Down Expand Up @@ -6514,6 +6510,8 @@ zpool_do_list(int argc, char **argv)
break;

pool_list_free(list);

(void) fflush(stdout);
(void) fsleep(interval);
}

Expand Down Expand Up @@ -9094,6 +9092,7 @@ zpool_do_status(int argc, char **argv)
if (count != 0 && --count == 0)
break;

(void) fflush(stdout);
robn marked this conversation as resolved.
Show resolved Hide resolved
(void) fsleep(interval);
}

Expand Down
Loading