OSDN Git Service

Repairing: add "repair=n" option.
authorrelan <relan@users.noreply.github.com>
Sat, 11 Mar 2017 06:20:01 +0000 (09:20 +0300)
committerrelan <relan@users.noreply.github.com>
Sat, 15 Sep 2018 04:18:41 +0000 (07:18 +0300)
Values:
  0 = do not repair
  1 = ask
  2 = repair automatically

libexfat/exfat.h
libexfat/mount.c

index e19c47b..e7022ca 100644 (file)
@@ -122,6 +122,7 @@ struct exfat
        gid_t gid;
        int ro;
        bool noatime;
+       enum { EXFAT_REPAIR_NO, EXFAT_REPAIR_ASK, EXFAT_REPAIR_YES } repair;
 };
 
 /* in-core nodes iterator */
index 3b18b12..cf8d3e8 100644 (file)
@@ -103,6 +103,19 @@ static void parse_options(struct exfat* ef, const char* options)
        ef->gid = get_int_option(options, "gid", 10, getegid());
 
        ef->noatime = match_option(options, "noatime");
+
+       switch (get_int_option(options, "repair", 10, 0))
+       {
+       case 1:
+               ef->repair = EXFAT_REPAIR_ASK;
+               break;
+       case 2:
+               ef->repair = EXFAT_REPAIR_YES;
+               break;
+       default:
+               ef->repair = EXFAT_REPAIR_NO;
+               break;
+       }
 }
 
 static bool verify_vbr_checksum(struct exfat_dev* dev, void* sector,