linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/1] f2fs-toos:fsck.f2fs Fix bad return value
@ 2020-10-26  9:40 Robin Hsu via Linux-f2fs-devel
  2020-10-28  6:57 ` Chao Yu
  2020-11-03  2:52 ` Eric Biggers
  0 siblings, 2 replies; 6+ messages in thread
From: Robin Hsu via Linux-f2fs-devel @ 2020-10-26  9:40 UTC (permalink / raw)
  To: linux-f2fs-devel, jaegeuk, chao; +Cc: linux-kernel

'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>
---
 fsck/fsck.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index f97e9fb..66e4e3f 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -3137,8 +3137,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
 		char ans[255] = {0};
 
 		printf("\nDo you want to restore lost files into ./lost_found/? [Y/N] ");
-		ret = scanf("%s", ans);
-		ASSERT(ret >= 0);
+		ASSERT(scanf("%s", ans) >= 0);
 		if (!strcasecmp(ans, "y")) {
 			for (i = 0; i < fsck->nr_nat_entries; i++) {
 				if (f2fs_test_bit(i, fsck->nat_area_bitmap))
-- 
2.29.0.rc2.309.g374f81d7ae-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-04 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-26  9:40 [f2fs-dev] [PATCH 1/1] f2fs-toos:fsck.f2fs Fix bad return value Robin Hsu via Linux-f2fs-devel
2020-10-28  6:57 ` Chao Yu
2020-11-02 16:09   ` Jaegeuk Kim
2020-11-03  2:52 ` Eric Biggers
2020-11-03  3:23   ` Jaegeuk Kim
     [not found]     ` <CAH7-xNRd1QBJUaxajijjrMbWdKKO1AKS2-1Q5HAAkHSUF628ug@mail.gmail.com>
2020-11-04 18:53       ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).