From f1663f307540a2a45b413118da22ff36158c6819 Mon Sep 17 00:00:00 2001 From: "giyeol.ok" Date: Tue, 14 May 2013 14:34:34 +0900 Subject: [PATCH] bug fix about directory handle close Change-Id: I1cba53bbbc0d34c8ddf743dbb07b150cd4abe6cf Signed-off-by: giyeol.ok --- src/mmc/mmc-handler.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)); -- 2.7.4