{
int ret = 0;
DIR *dp = NULL;
- struct dirent ep;
- struct dirent *er = NULL;
+ struct dirent *ep = NULL;
char abs_filename[FILENAME_MAX] = { 0, };
dp = opendir(dirname);
if (dp != NULL) {
- while (readdir_r(dp, &ep, &er) == 0 && er != NULL) {
+ while ((ep = readdir(dp)) != NULL) {
char mmc_path[PATH_MAX] = {0};
- if (!strcmp(ep.d_name, ".") || !strcmp(ep.d_name, ".."))
+ if (!strcmp(ep->d_name, ".") || !strcmp(ep->d_name, ".."))
continue;
/*get realpath find symlink to ".mmc" and unlink it*/
- snprintf(abs_filename, FILENAME_MAX, "%s/%s", dirname, ep.d_name);
+ snprintf(abs_filename, FILENAME_MAX, "%s/%s", dirname, ep->d_name);
char *path = realpath(abs_filename, mmc_path);
if (!path)
_E("realpath failed");
{
static unsigned long long total = 0;
DIR *dp = NULL;
- struct dirent ep;
- struct dirent *er = NULL;
+ struct dirent *ep = NULL;
char abs_filename[FILENAME_MAX] = { 0, };;
dp = opendir(dirname);
if (dp != NULL) {
- while (readdir_r(dp, &ep, &er) == 0 && er != NULL) {
+ while ((ep = readdir(dp)) != NULL) {
struct stat stFileInfo;
snprintf(abs_filename, FILENAME_MAX, "%s/%s", dirname,
- ep.d_name);
+ ep->d_name);
if (stat(abs_filename, &stFileInfo) < 0)
perror(abs_filename);
total += stFileInfo.st_size;
if (S_ISDIR(stFileInfo.st_mode)) {
- if (strcmp(ep.d_name, ".")
- && strcmp(ep.d_name, "..")) {
+ if (strcmp(ep->d_name, ".")
+ && strcmp(ep->d_name, "..")) {
_app2sd_calculate_dir_size
(abs_filename);
}