summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-06-25 09:54:38 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-25 09:54:38 -0700
commit64e1c16cc58f1aa492c96a7078ee50220b00fece (patch)
tree99ec94d8a254dc8ef71d1f82ab0c41e5d71f1c51
parent715c03a10b825dc7cae78f8a6da7a8956beefb8d (diff)
parente7f444f32986f975b788ecf3962cb2cce27828e8 (diff)
downloadsystem_core-64e1c16cc58f1aa492c96a7078ee50220b00fece.zip
system_core-64e1c16cc58f1aa492c96a7078ee50220b00fece.tar.gz
system_core-64e1c16cc58f1aa492c96a7078ee50220b00fece.tar.bz2
am e7f444f3: vold: Switch vfat fsck tools
Merge commit 'e7f444f32986f975b788ecf3962cb2cce27828e8' * commit 'e7f444f32986f975b788ecf3962cb2cce27828e8': vold: Switch vfat fsck tools
-rw-r--r--vold/volmgr_vfat.c66
1 files changed, 20 insertions, 46 deletions
diff --git a/vold/volmgr_vfat.c b/vold/volmgr_vfat.c
index 7833222..835b71d 100644
--- a/vold/volmgr_vfat.c
+++ b/vold/volmgr_vfat.c
@@ -26,7 +26,7 @@
#define VFAT_DEBUG 0
-static char FSCK_MSDOS_PATH[] = "/system/bin/dosfsck";
+static char FSCK_MSDOS_PATH[] = "/system/bin/fsck_msdos";
int vfat_identify(blkdev_t *dev)
{
@@ -51,51 +51,25 @@ int vfat_check(blkdev_t *dev)
return 0;
}
- do {
-
- char *args[6];
- args[0] = FSCK_MSDOS_PATH;
- args[1] = "-v";
-
- if (rw) {
- args[2] = "-w";
- args[3] = "-p";
- args[4] = blkdev_get_devpath(dev);
- args[5] = NULL;
- rc = logwrap(5, args, 1);
- free(args[4]);
- } else {
- args[2] = "-n";
- args[3] = blkdev_get_devpath(dev);
- args[4] = NULL;
- rc = logwrap(4, args, 1);
- free(args[3]);
- }
-
- if (rc == 0) {
- LOG_VOL("Filesystem check completed OK");
- return 0;
- } else if (rc == 1) {
- LOG_VOL("Filesystem check failed (general failure)");
- return -EINVAL;
- } else if (rc == 2) {
- LOG_VOL("Filesystem check failed (invalid usage)");
- return -EIO;
- } else if (rc == 4) {
- LOG_VOL("Filesystem check completed (errors fixed)");
- } else if (rc == 6) {
- LOG_VOL("Filesystem read-only - retrying check RO");
- rw = false;
- continue;
- } else if (rc == 8) {
- LOG_VOL("Filesystem check failed (not a FAT filesystem)");
- return -ENODATA;
- } else {
- LOG_VOL("Filesystem check failed (unknown exit code %d)", rc);
- return -EIO;
- }
- } while (0);
-
+ char *args[5];
+ args[0] = FSCK_MSDOS_PATH;
+ args[1] = "-p";
+ args[2] = "-f";
+ args[3] = blkdev_get_devpath(dev);
+ args[4] = NULL;
+ rc = logwrap(4, args, 1);
+ free(args[3]);
+
+ if (rc == 0) {
+ LOG_VOL("Filesystem check completed OK");
+ return 0;
+ } else if (rc == 2) {
+ LOG_VOL("Filesystem check failed (not a FAT filesystem)");
+ return -ENODATA;
+ } else {
+ LOG_VOL("Filesystem check failed (unknown exit code %d)", rc);
+ return -EIO;
+ }
return 0;
}