Commit 4f2c166e authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_fsck_ask_yn()

 - getline() output includes a newline, without stripping that we were
   just looping

 - Make the prompt clearer
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 21da6101
...@@ -85,12 +85,13 @@ enum ask_yn bch2_fsck_ask_yn(void) ...@@ -85,12 +85,13 @@ enum ask_yn bch2_fsck_ask_yn(void)
bool ret; bool ret;
while (true) { while (true) {
fputs(" (y,n,Y,N) ", stdout); fputs(" (y,n, or Y,N for all errors of this type) ", stdout);
fflush(stdout); fflush(stdout);
if (getline(&buf, &buflen, stdin) < 0) if (getline(&buf, &buflen, stdin) < 0)
die("error reading from standard input"); die("error reading from standard input");
strim(buf);
if (strlen(buf) != 1) if (strlen(buf) != 1)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment