[UTC][media-content][Non ACR][Fix intermittent failure] 82/212882/2
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 28 Aug 2019 01:04:51 +0000 (10:04 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 28 Aug 2019 04:58:34 +0000 (13:58 +0900)
Change-Id: I1e3f3d1f8963bc51ad67f05a523e87572a1f812e
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/utc/media-content/utc-media-content.c

index 4dcf45c4721a5368a9bbf79cfabe6c25cca7f8a0..a1df34ec0d556b65029165f0be5f6fc7bb2ddc51 100755 (executable)
@@ -109,17 +109,17 @@ void utc_media_content_startup(void)
                return;
        }
 
-       char test_copy[256] = {0, };
-       snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_insert_path);
-
-       ret = system(test_copy);
-       if (ret != MEDIA_CONTENT_ERROR_NONE) {
-               fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
-               fprintf(stderr, "\"%s\" failed (code: %d)\n", test_copy, ret);
-               startup_ret = ret;
-               return;
+       if (!g_file_test(g_insert_path, G_FILE_TEST_EXISTS)) {
+               char test_copy[256] = {0, };
+               snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_insert_path);
+
+               if (system(test_copy) < 0) {
+                       fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+                       fprintf(stderr, "\"%s\" failed (code: %d)\n", test_copy, ret);
+                       startup_ret = -1;
+                       return;
+               }
        }
-
 }