}
static long long __calculate_shared_dir_size(int dfd, const char *app_root_dir,
- long long *data_size, long long *app_size)
+ long long *data_size, long long *app_size,
+ long long *cache_size)
{
int fd = -1;
int subfd = -1;
LOGE("Calculating shared/cache directory failed.");
goto error;
}
- *data_size += size;
- LOGD("data_size: %lld", *data_size);
+ *cache_size += size;
+ LOGD("cache_size: %lld", *cache_size);
close(subfd);
} else if (subfd < 0 && errno != ENOENT) {
LOGE("openat() failed, file_info: data, errno: %d (%s)",
LOGD("cache_size: %lld", *cache_size);
} else if (strncmp(name, "shared", strlen("shared")) == 0) {
size = __calculate_shared_dir_size(dfd, app_root_dir,
- data_size, app_size);
+ data_size, app_size, cache_size);
if (size < 0) {
LOGE("Calculating shared directory failed.");
goto error;