int app2sd_enable_full_pkg(void)
{
int ret = APP2EXT_SUCCESS;
- int rc = 0;
char buf[FILENAME_MAX] = { 0, };
char app2sd_path[FILENAME_MAX] = { 0, };
char loopback_device[FILENAME_MAX] = { 0, };
char *sdpath = NULL;
char *pkgid = NULL;
DIR *dir = NULL;
- struct dirent entry;
- struct dirent *result = NULL;
+ struct dirent *entry = NULL;
uid_t uid = 0;
/* check whether MMC is present or not */
return APP2EXT_ERROR_SQLITE_REGISTRY;
}
- for (rc = readdir_r(dir, &entry, &result);
- rc == 0 && result != NULL;
- rc = readdir_r(dir, &entry, &result)) {
- if (strcmp(entry.d_name, ".") == 0 ||
- strcmp(entry.d_name, "..") == 0)
+ while ((entry = readdir(dir)) != NULL) {
+ if (strcmp(entry->d_name, ".") == 0 ||
+ strcmp(entry->d_name, "..") == 0)
continue;
snprintf(loopback_device, FILENAME_MAX - 1, "%s/%s",
- app2sd_path, entry.d_name);
+ app2sd_path, entry->d_name);
ret = _app2sd_get_info_from_db(loopback_device,
&pkgid, &uid);
if (ret) {