mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 01:37:17 -04:00
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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -85,12 +85,13 @@ enum ask_yn bch2_fsck_ask_yn(void)
|
||||
bool ret;
|
||||
|
||||
while (true) {
|
||||
fputs(" (y,n,Y,N) ", stdout);
|
||||
fputs(" (y,n, or Y,N for all errors of this type) ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
if (getline(&buf, &buflen, stdin) < 0)
|
||||
die("error reading from standard input");
|
||||
|
||||
strim(buf);
|
||||
if (strlen(buf) != 1)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user