block: remove external-storage call if block module is not supported
[platform/core/system/libstorage.git] / src / statvfs.c
index eda17bd..7b50dc4 100644 (file)
@@ -346,6 +346,10 @@ int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
        if (path)
                snprintf(ext_path, sizeof(ext_path), "%s", path);
        else {
+               if (!storage_ext_is_supported()) {
+                       _D("Block module is not enabled");
+                       goto out_nodev;
+               }
                ret = get_external_path(ext_path, sizeof(ext_path));
                if (ret == -ENODEV)
                        goto out_nodev;
@@ -386,6 +390,10 @@ int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf
        if (path)
                snprintf(ext_path, sizeof(ext_path), "%s", path);
        else {
+               if (!storage_ext_is_supported()) {
+                       _D("Block module is not enabled");
+                       goto out_nodev;
+               }
                ret = get_external_path(ext_path, sizeof(ext_path));
                if (ret == -ENODEV)
                        goto out_nodev;