From 9487d2965f3e4ed8113af5b534d5b22185415545 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 18 Dec 2011 13:49:52 -0800 Subject: [PATCH] add comments around /data/media Change-Id: I35ad822ed602e2b1018f1e1a0d67499867b60a40 --- nandroid.c | 2 +- roots.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nandroid.c b/nandroid.c index 76d0962..fc39359 100644 --- a/nandroid.c +++ b/nandroid.c @@ -437,7 +437,7 @@ int nandroid_restore_partition_extended(const char* backup_path, const char* mou } // If the fs_type of this volume is "auto" or mount_point is /data - // and vol for /sdcard is NULL and is_data_media, let's revert + // and is_data_media (redundantly, and vol for /sdcard is NULL), let's revert // to using a rm -rf, rather than trying to do a // ext3/ext4/whatever format. // This is because some phones (like DroidX) will freak out if you diff --git a/roots.c b/roots.c index 4997350..9a43bb4 100644 --- a/roots.c +++ b/roots.c @@ -334,8 +334,10 @@ int format_volume(const char* volume) { LOGE("unknown volume \"%s\"\n", volume); return -1; } + // check to see if /data is being formatted, and if it is /data/media + // Note: the /sdcard check is redundant probably, just being safe. if (strstr(volume, "/data") == volume && volume_for_path("/sdcard") == NULL && is_data_media()) { - return format_unknown_device(NULL, volume, NULL); + return format_unknown_device(NULL, volume, NULL); } if (strcmp(v->fs_type, "ramdisk") == 0) { // you can't format the ramdisk.