X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugin%2Fapp2sd%2Fserver%2Fapp2sd_internals_utils.c;h=970db563702c367e2ac2619aff9a8bfbb0268c39;hb=981229a12109b66c23c039bac80daf2727e66861;hp=51bd6effc9b5e378b2e9fb927e59530a69d4454c;hpb=7fda3065bc54b7e0f7bc06d20d6d5999b50c73d3;p=platform%2Fcore%2Fappfw%2Fapp2sd.git diff --git a/plugin/app2sd/server/app2sd_internals_utils.c b/plugin/app2sd/server/app2sd_internals_utils.c index 51bd6ef..970db56 100644 --- a/plugin/app2sd/server/app2sd_internals_utils.c +++ b/plugin/app2sd/server/app2sd_internals_utils.c @@ -142,20 +142,19 @@ void _app2sd_delete_symlink(const char *dirname) { 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"); @@ -238,17 +237,16 @@ unsigned long long _app2sd_calculate_dir_size(char *dirname) { 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); @@ -256,8 +254,8 @@ unsigned long long _app2sd_calculate_dir_size(char *dirname) 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); }