-- limitations under the License.
--
PRAGMA user_version = 105;
+PRAGMA journal_mode = WAL;
CREATE TABLE schedule_table
(
static inline int __remake_db_file(char* db_path)
{
- int ret, fd;
+ int ret;
char *errmsg;
sqlite3 *db;
char db_file[CAL_STR_MIDDLE_LEN] = {0};
- char jn_file[CAL_STR_MIDDLE_LEN] = {0};
snprintf(db_file, sizeof(db_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_DB_NAME);
sqlite3_free(errmsg);
}
db_util_close(db);
-
- fd = open(db_file, O_CREAT | O_RDWR, 0660);
- if (-1 == fd) {
- ERR("open Fail ");
- return -1;
- }
- fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
- close(fd);
-
- snprintf(jn_file, sizeof(jn_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_JN_NAME);
- DBG("[%s]", jn_file);
-
- fd = open(jn_file, O_CREAT | O_RDWR, 0660);
- if (-1 == fd) {
- ERR("open Fail ");
- return -1;
- }
- fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
- close(fd);
-
return 0;
}
#include "calendar_list.h"
#define CALS_DB_NAME ".calendar-svc.db"
-#define CALS_JN_NAME ".calendar-svc.db-journal"
#define DB_PATH tzplatform_getenv(TZ_USER_DB)
#define DATA_PATH tzplatform_getenv(TZ_USER_DATA)
#define CAL_DB_FILE tzplatform_mkpath(TZ_USER_DB, ".calendar-svc.db")
-#define CAL_JN_FILE tzplatform_mkpath(TZ_USER_DB, ".calendar-svc.db-journal")
#define CAL_DATA_PATH tzplatform_mkpath(TZ_USER_DATA, "calendar-svc")
/* For Security */