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
This commit is contained in:
Wen-Chih Lo 2023-06-08 13:21:21 +08:00 committed by Lili Lin
parent 39f11368a5
commit 5b9fd68dfa

View file

@ -48,6 +48,9 @@ status_t Check(const std::string& source) {
if (rc == 0) { if (rc == 0) {
LOG(INFO) << "Check OK"; LOG(INFO) << "Check OK";
return 0; return 0;
} else if (rc == 1) {
LOG(INFO) << "Filesystem errors corrected";
return 0;
} else { } else {
LOG(ERROR) << "Check failed (code " << rc << ")"; LOG(ERROR) << "Check failed (code " << rc << ")";
errno = EIO; errno = EIO;