From f1b07fb5e30667833d7a2a5b7e95eada881a2802 Mon Sep 17 00:00:00 2001 From: San Mehat Date: Tue, 2 Mar 2010 13:16:33 -0800 Subject: [PATCH] vold: Don't bail out on init failure & bump version number Signed-off-by: San Mehat --- main.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/main.cpp b/main.cpp index 2412612..551003b 100644 --- a/main.cpp +++ b/main.cpp @@ -42,7 +42,7 @@ int main() { CommandListener *cl; NetlinkManager *nm; - LOGI("Vold 2.0 (the revenge) firing up"); + LOGI("Vold 2.1 (the revenge) firing up"); mkdir("/dev/block/vold", 0755); @@ -68,8 +68,7 @@ int main() { } if (process_config(vm)) { - LOGE("Error reading configuration (%s)", strerror(errno)); - exit(1); + LOGE("Error reading configuration (%s)... continuing anyways", strerror(errno)); } if (nm->start()) { @@ -89,18 +88,16 @@ int main() { if ((fp = fopen("/sys/devices/virtual/switch/usb_mass_storage/state", "r"))) { - if (!fgets(state, sizeof(state), fp)) { - LOGE("Failed to read switch state (%s)", strerror(errno)); - fclose(fp); - exit(1); - } - if (!strncmp(state, "online", 6)) { - LOGD("Bootstrapped ums is connected"); - vm->notifyUmsConnected(true); + if (fgets(state, sizeof(state), fp)) { + if (!strncmp(state, "online", 6)) { + vm->notifyUmsConnected(true); + } else { + vm->notifyUmsConnected(false); + } } else { - LOGD("Bootstrapped ums is disconnected"); - vm->notifyUmsConnected(false); + LOGE("Failed to read switch state (%s)", strerror(errno)); } + fclose(fp); } else { LOGW("No UMS switch available");