X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugin%2Fapp2sd%2Fcommon%2Fsrc%2Fapp2sd_utils.c;h=270f5fc1b27d0f1c116f962ad206bf2e3b6dc9f4;hb=6c4aadc55ab50ea90e516b1e2ed9fa63c4e2e5d6;hp=e2e1a8ded53cd079155ba8a05a4767f549e19f23;hpb=7fda3065bc54b7e0f7bc06d20d6d5999b50c73d3;p=platform%2Fcore%2Fappfw%2Fapp2sd.git diff --git a/plugin/app2sd/common/src/app2sd_utils.c b/plugin/app2sd/common/src/app2sd_utils.c index e2e1a8d..270f5fc 100644 --- a/plugin/app2sd/common/src/app2sd_utils.c +++ b/plugin/app2sd/common/src/app2sd_utils.c @@ -50,18 +50,17 @@ char *_app2sd_get_encoded_name(const char *pkgid, uid_t uid) int _app2sd_delete_directory(const char *dirname) { DIR *dp = NULL; - struct dirent ep; - struct dirent *er = NULL; + struct dirent *ep = NULL; char abs_filename[FILENAME_MAX] = { 0, }; int ret = 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 (lstat(abs_filename, &stFileInfo) < 0) { perror(abs_filename); @@ -70,8 +69,8 @@ int _app2sd_delete_directory(const char *dirname) } if (S_ISDIR(stFileInfo.st_mode)) { - if (strcmp(ep.d_name, ".") - && strcmp(ep.d_name, "..")) { + if (strcmp(ep->d_name, ".") + && strcmp(ep->d_name, "..")) { ret = _app2sd_delete_directory(abs_filename); if (ret < 0) { (void)closedir(dp);