Add failure log for removing corrupted ini file 00/198100/4 accepted/tizen/unified/20190128.061554 submit/tizen/20190123.014254
authorSeokHoon LEE <andy.shlee@samsung.com>
Mon, 21 Jan 2019 01:07:30 +0000 (10:07 +0900)
committerSeokHoon LEE <andy.shlee@samsung.com>
Mon, 21 Jan 2019 08:36:35 +0000 (17:36 +0900)
- Add g_remove failed log

Change-Id: Id3a7f0533385e9fba0212bd83b1590af08f08d28
Signed-off-by: SeokHoon LEE <andy.shlee@samsung.com>
packaging/libmm-streamrecorder.spec
src/mm_streamrecorder_ini.c

index 7454e41..3a23d44 100644 (file)
@@ -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
index d3f88c1..787c0c3 100644 (file)
@@ -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);
+                       }
                }
        }