From: giyeol.ok Date: Tue, 14 May 2013 05:34:34 +0000 (+0900) Subject: bug fix about directory handle close X-Git-Tag: submit/tizen_ivi_release/20140401.030119~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1663f307540a2a45b413118da22ff36158c6819;p=platform%2Fcore%2Fsystem%2Fsystem-server.git bug fix about directory handle close Change-Id: I1cba53bbbc0d34c8ddf743dbb07b150cd4abe6cf Signed-off-by: giyeol.ok --- diff --git a/src/mmc/mmc-handler.c b/src/mmc/mmc-handler.c index cd61377..bb0cebf 100644 --- a/src/mmc/mmc-handler.c +++ b/src/mmc/mmc-handler.c @@ -128,7 +128,13 @@ int get_mmcblk_num(void) _E("Can not open directory: /sys/block"); return -1; } - chdir("/sys/block"); + + r = chdir("/sys/block"); + if (r < 0) { + _E("Fail to change the directory.."); + closedir(dp); + return r; + } while ((dir = readdir(dp)) != NULL) { memset(&stat, 0, sizeof(struct stat));