#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)
#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;
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;
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;
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)
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();
}
}
- 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();
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);