f2fs-toos: fsck.f2fs Fix bad return value

'ret' should not have been used here: otherwise, it would be wrongly used
as the error code and then be returned from main().

Signed-off-by: Robin Hsu <robinhsu@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Robin Hsu 2020-10-26 17:40:00 +08:00 committed by Jaegeuk Kim
parent c954e7cc4b
commit ca0ed8a66f

View File

@ -3146,10 +3146,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
#ifndef WITH_ANDROID
if (nr_unref_nid && !c.ro) {
char ans[255] = {0};
int res;
printf("\nDo you want to restore lost files into ./lost_found/? [Y/N] ");
ret = scanf("%s", ans);
ASSERT(ret >= 0);
res = scanf("%s", ans);
ASSERT(res >= 0);
if (!strcasecmp(ans, "y")) {
for (i = 0; i < fsck->nr_nat_entries; i++) {
if (f2fs_test_bit(i, fsck->nat_area_bitmap))