From 8bf382adada43023bc1819067cc024f7acfd1a07 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 7 Jun 2017 11:32:35 +0800 Subject: [PATCH] Apparently, not every device uses emmc --- jni/utils/misc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jni/utils/misc.c b/jni/utils/misc.c index f70436f26..a5c91bf29 100644 --- a/jni/utils/misc.c +++ b/jni/utils/misc.c @@ -191,7 +191,10 @@ void unlock_blocks() { return; while((entry = readdir(dir))) { - if (entry->d_type == DT_BLK && strstr(entry->d_name, "mmc") != NULL) { + if (entry->d_type == DT_BLK && + strstr(entry->d_name, "ram") == NULL && + strstr(entry->d_name, "loop") == NULL && + strstr(entry->d_name, "dm-0") == NULL) { snprintf(path, sizeof(path), "%s/%s", DEV_BLOCK, entry->d_name); if ((fd = xopen(path, O_RDONLY)) < 0) continue;