From: SeokHoon LEE Date: Mon, 21 Jan 2019 01:07:30 +0000 (+0900) Subject: Add failure log for removing corrupted ini file X-Git-Tag: submit/tizen/20190123.014254^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0aee4a2c55166b78fcec8dcda732f33841e89158;p=platform%2Fcore%2Fmultimedia%2Flibmm-streamrecorder.git Add failure log for removing corrupted ini file - Add g_remove failed log Change-Id: Id3a7f0533385e9fba0212bd83b1590af08f08d28 Signed-off-by: SeokHoon LEE --- diff --git a/packaging/libmm-streamrecorder.spec b/packaging/libmm-streamrecorder.spec index 7454e41..3a23d44 100644 --- a/packaging/libmm-streamrecorder.spec +++ b/packaging/libmm-streamrecorder.spec @@ -1,6 +1,6 @@ Name: libmm-streamrecorder Summary: Media Stream Recorder library -Version: 0.0.22 +Version: 0.0.23 Release: 0 Group: Multimedia/Other License: Apache-2.0 diff --git a/src/mm_streamrecorder_ini.c b/src/mm_streamrecorder_ini.c index d3f88c1..787c0c3 100644 --- a/src/mm_streamrecorder_ini.c +++ b/src/mm_streamrecorder_ini.c @@ -323,7 +323,8 @@ void __get_element_list(mm_streamrecorder_ini_t* ini, gchar* str, int keyword static void __mm_streamrecorder_ini_check_status(void) { - struct stat ini_buff; + GStatBuf ini_buff; + char buf[255] = {0, }; _mmstreamrec_dbg_warn("enter"); @@ -332,7 +333,10 @@ void __mm_streamrecorder_ini_check_status(void) } else { if (ini_buff.st_size < 5) { _mmstreamrec_dbg_err("mmfw_streamrecorder.ini file size=%d, Corrupted! So, Removed\n", (int)ini_buff.st_size); - g_remove(MM_STREAMRECORDER_INI_DEFAULT_PATH); + if (g_remove(MM_STREAMRECORDER_INI_DEFAULT_PATH) == -1) { + strerror_r(errno, buf, sizeof(buf)); + _mmstreamrec_dbg_err("failed to delete corrupted ini [%s]", buf); + } } }