Added the check file exists 96/50996/1 accepted/tizen/mobile/20151105.020239 accepted/tizen/tv/20151105.020259 accepted/tizen/wearable/20151105.020308 submit/tizen/20151105.001741
authorSunghyun Kwon <sh0701.kwon@samsung.com>
Wed, 4 Nov 2015 09:53:03 +0000 (18:53 +0900)
committerSunghyun Kwon <sh0701.kwon@samsung.com>
Wed, 4 Nov 2015 09:53:03 +0000 (18:53 +0900)
Change-Id: Idb86bf1861de30e635160d6d58370776dd15fa4c

email-core/email-storage/email-storage.c

index ce51aad..fcf3fc3 100755 (executable)
@@ -2045,10 +2045,12 @@ INTERNAL_FUNC int emstorage_open(char *multi_user_name, int *err_code)
         SNPRINTF(buf, sizeof(buf), "%s/%s", prefix_path, DB_PATH);
     }
 
-    retValue = mkdir(buf, DIRECTORY_PERMISSION);
+       if (!g_file_test(buf, G_FILE_TEST_EXISTS)) {
+           retValue = mkdir(buf, DIRECTORY_PERMISSION);
 
-    EM_DEBUG_LOG("mkdir return- %d", retValue);
-    EM_DEBUG_LOG("emstorage_open - before sqlite3_open - pid = %d", getpid());
+               EM_DEBUG_LOG("mkdir return- %d", retValue);
+           EM_DEBUG_LOG("emstorage_open - before sqlite3_open - pid = %d", getpid());
+       }
 
     if (emstorage_db_open(multi_user_name, &error) == NULL) {
         EM_DEBUG_EXCEPTION("emstorage_db_open failed[%d]", error);