+bool _is_mounted(const char *dir_path)
+{
+ bool ret = false;
+ char mount_path[MAX_PATH_LEN] = {0,};
+ char root_path[MAX_PATH_LEN] = {0,};
+ struct mntent *mnt;
+ const char *table = "/etc/mtab";
+ FILE *fp;
+
+ snprintf(root_path, MAX_PATH_LEN, "%s%s", tzplatform_getenv(TZ_SYS_STORAGE), "/USBDrive");
+ if (!g_str_has_prefix(dir_path, root_path))
+ return true;
+
+ char *p = strstr(dir_path + strlen(root_path), "/");
+ if(p && p - dir_path < MAX_PATH_LEN)
+ strncpy(mount_path, dir_path, p - dir_path);
+ else
+ snprintf(mount_path, MAX_PATH_LEN, "%s", dir_path);
+
+ fp = setmntent(table, "r");
+ if (!fp) {
+ content_error("open /etc/mtab failed");
+ return false;
+ }
+ while ((mnt = getmntent(fp))) {
+ if (!strncmp(mnt->mnt_dir, mount_path, strlen(mount_path))) {
+ ret = true;
+ break;
+ }
+ }
+ endmntent(fp);
+
+ content_error("[NO ERROR] dir_path[%s] mount_path[%s] ret[%d]", dir_path, mount_path, ret);
+ return ret;
+}
+