From 5b9fd68dfaee202dbd53919c9d454d32666b66c3 Mon Sep 17 00:00:00 2001 From: Wen-Chih Lo Date: Thu, 8 Jun 2023 13:21:21 +0800 Subject: [PATCH] Handle errors corrected exit status returned by fsck Properly handle the exit status 1, which shows filesystem errors corrected, returned by fsck. Test: manually hot-plugs SD card and check logcat logs Change-Id: Iacaa8b1d1a7b59931014c1ab6a4708ffc3cd0c06 --- fs/Exfat.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp index c8b19e0..ed53921 100644 --- a/fs/Exfat.cpp +++ b/fs/Exfat.cpp @@ -48,6 +48,9 @@ status_t Check(const std::string& source) { if (rc == 0) { LOG(INFO) << "Check OK"; return 0; + } else if (rc == 1) { + LOG(INFO) << "Filesystem errors corrected"; + return 0; } else { LOG(ERROR) << "Check failed (code " << rc << ")"; errno = EIO;