diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-05 01:08:56 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:10:03 +0300 |
commit | 4f2c166ebe5baef20e28866b27dd97b0caa585f1 (patch) | |
tree | 397a9d3c59116d6527db80aebf1b4a0d6d3734f1 /fs | |
parent | 21da6101bd947a08104dbf7d7cb22b40be7730e8 (diff) | |
download | linux-4f2c166ebe5baef20e28866b27dd97b0caa585f1.tar.xz |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/error.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index 545c55dabc27..b08cd23dee00 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -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; |