summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>2018-04-28 13:20:26 +0530
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>2018-04-28 13:26:57 +0530
commitfba773115286946c633a8d01b927d19b52e8bdea (patch)
treef9ad321380876984a800543615232ba02b8dac6b
parent0210dd568c4b53d37b22659affdc581b278ed29f (diff)
downloademail-service-fba773115286946c633a8d01b927d19b52e8bdea.tar.gz
email-service-fba773115286946c633a8d01b927d19b52e8bdea.tar.bz2
email-service-fba773115286946c633a8d01b927d19b52e8bdea.zip
Change-Id: I83f501c6aa08237aac28dbd4a419e835bf912832 Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
-rwxr-xr-xemail-core/email-storage/email-storage.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c
index 521ed0e..d13b146 100755
--- a/email-core/email-storage/email-storage.c
+++ b/email-core/email-storage/email-storage.c
@@ -143,8 +143,8 @@
#define DAYLIGHT_NAME_LEN_IN_MAIL_MEETING_TBL 32
#define PREVIEWBODY_LEN_IN_MAIL_TBL 512
#define CERTIFICATE_PATH_LEN_IN_MAIL_ACCOUNT_TBL 256
-#define UID "root" /* UID = root */
-#define UID_DEFAULT 0 /* UID = root */
+#define UID "root" /* UID = root */
+#define UID_DEFAULT 0 /* UID = root */
#define GID "priv_email" /* GID = priv_email */
#define GID_DEFAULT 10901 /* GID = priv_email */
#define MAX_GRP_BUF_SIZE (1024 * 4)
@@ -201,8 +201,8 @@ static pthread_mutex_t _db_handle_lock = PTHREAD_MUTEX_INITIALIZER;
#ifdef _MULTIPLE_DB_HANDLE
typedef struct {
- char *user_name;
- pthread_t thread_id;
+ char *user_name;
+ pthread_t thread_id;
sqlite3 *db_handle;
} db_handle_t;
@@ -265,8 +265,8 @@ int emstorage_set_db_handle(char *multi_user_name, sqlite3 *db_handle)
if (_db_handle_list[i].thread_id == 0) {
_db_handle_list[i].thread_id = current_thread_id;
_db_handle_list[i].db_handle = db_handle;
- /* Only distinguished container and host */
- _db_handle_list[i].user_name = EM_SAFE_STRDUP(multi_user_name);
+ /* Only distinguished container and host */
+ _db_handle_list[i].user_name = EM_SAFE_STRDUP(multi_user_name);
EM_DEBUG_LOG("current_thread_id [%d], index [%d]", current_thread_id, i);
error_code = EMAIL_ERROR_NONE;
break;
@@ -290,7 +290,7 @@ int emstorage_remove_db_handle()
if (_db_handle_list[i].thread_id == THREAD_SELF()) {
_db_handle_list[i].thread_id = 0;
_db_handle_list[i].db_handle = NULL;
- EM_SAFE_FREE(_db_handle_list[i].user_name);
+ EM_SAFE_FREE(_db_handle_list[i].user_name);
EM_DEBUG_LOG("index [%d]", i);
error_code = EMAIL_ERROR_NONE;
@@ -315,7 +315,7 @@ int emstorage_reset_db_handle_list()
for (i = 0; i < MAX_DB_CLIENT; i++) {
_db_handle_list[i].thread_id = 0;
_db_handle_list[i].db_handle = NULL;
- EM_SAFE_FREE(_db_handle_list[i].user_name);
+ EM_SAFE_FREE(_db_handle_list[i].user_name);
}
LEAVE_CRITICAL_SECTION(_db_handle_lock)
@@ -436,8 +436,8 @@ INTERNAL_FUNC int emstorage_shm_file_init(const char *shm_file_name)
pthread_mutex_init(&(m->mutex), &mattr);
pthread_mutexattr_destroy(&mattr);
- pthread_mutex_destroy(&(m->mutex));
- munmap(m, sizeof(mmapped_t));
+ pthread_mutex_destroy(&(m->mutex));
+ munmap(m, sizeof(mmapped_t));
EM_SAFE_CLOSE(fd);
EM_DEBUG_FUNC_END();
@@ -480,29 +480,29 @@ int _initialize_shm_mutex(const char *shm_file_name, int *param_shm_fd, mmapped_
}
}
- fchmod((*param_shm_fd), 0644);
- EM_DEBUG_LOG("** Create SHM FILE **");
- if (ftruncate((*param_shm_fd), sizeof(mmapped_t)) != 0) {
- EM_DEBUG_EXCEPTION("ftruncate errno [%d]", errno);
- return EMAIL_ERROR_SYSTEM_FAILURE;
- }
+ fchmod((*param_shm_fd), 0644);
+ EM_DEBUG_LOG("** Create SHM FILE **");
+ if (ftruncate((*param_shm_fd), sizeof(mmapped_t)) != 0) {
+ EM_DEBUG_EXCEPTION("ftruncate errno [%d]", errno);
+ return EMAIL_ERROR_SYSTEM_FAILURE;
+ }
- mmapped_t *tmp = (mmapped_t *)mmap(NULL, sizeof(mmapped_t), PROT_READ|PROT_WRITE, MAP_SHARED, (*param_shm_fd), 0);
- if (tmp == MAP_FAILED) {
- EM_DEBUG_EXCEPTION("mmap failed: %s", EM_STRERROR(errno_buf));
- return EMAIL_ERROR_SYSTEM_FAILURE;
- }
+ mmapped_t *tmp = (mmapped_t *)mmap(NULL, sizeof(mmapped_t), PROT_READ|PROT_WRITE, MAP_SHARED, (*param_shm_fd), 0);
+ if (tmp == MAP_FAILED) {
+ EM_DEBUG_EXCEPTION("mmap failed: %s", EM_STRERROR(errno_buf));
+ return EMAIL_ERROR_SYSTEM_FAILURE;
+ }
- tmp->data = 0;
+ tmp->data = 0;
- pthread_mutexattr_t mattr;
- pthread_mutexattr_init(&mattr);
- pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
- pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST_NP);
- pthread_mutex_init(&(tmp->mutex), &mattr);
- pthread_mutexattr_destroy(&mattr);
+ pthread_mutexattr_t mattr;
+ pthread_mutexattr_init(&mattr);
+ pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
+ pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST_NP);
+ pthread_mutex_init(&(tmp->mutex), &mattr);
+ pthread_mutexattr_destroy(&mattr);
- *param_mapped = tmp;
+ *param_mapped = tmp;
}
EM_DEBUG_FUNC_END();
@@ -4723,7 +4723,7 @@ INTERNAL_FUNC int emstorage_get_sync_status_of_account(char *multi_user_name, in
return false;
}
- int error = EMAIL_ERROR_NONE, rc, ret = false, sync_status, count, i, col_index;
+ int error = EMAIL_ERROR_NONE, rc, ret = false, sync_status = 0, count, i, col_index;
char sql_query_string[QUERY_SIZE] = {0, };
char **result = NULL;
sqlite3 *local_db_handle = emstorage_get_db_connection(multi_user_name);