OSDN Git Service
(root)
/
android-x86
/
system-vold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b087b8a
)
Volume: Don't crap out when dealing with unformatted cards
author
Ricardo Cerqueira
<cyanogenmod@cerqueira.org>
Fri, 7 Mar 2014 02:24:26 +0000
(
02:24
+0000)
committer
Chih-Wei Huang
<cwhuang@linux.org.tw>
Sat, 22 Aug 2015 14:44:35 +0000
(22:44 +0800)
Change-Id: I2ab58328d07a343a5ec9e1c4b58f8258f0c9133c
Volume.cpp
patch
|
blob
|
history
diff --git
a/Volume.cpp
b/Volume.cpp
index
097626a
..
a38668b
100644
(file)
--- a/
Volume.cpp
+++ b/
Volume.cpp
@@
-298,6
+298,13
@@
int Volume::formatVol(bool wipe) {
fstype = getFsType((const char*)devicePath);
+ /* If the device has no filesystem, let's default to vfat.
+ * A NULL fstype will cause a MAPERR in the format
+ * switch below */
+ if (fstype == NULL) {
+ fstype = strdup("vfat");
+ }
+
if (mDebug) {
SLOGI("Formatting volume %s (%s) as %s", getLabel(), devicePath, fstype);
}