projects
/
platform
/
core
/
appfw
/
pkgmgr-info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change the timing of adding sqlite busy handler
[platform/core/appfw/pkgmgr-info.git]
/
parser
/
src
/
pkgmgr_parser_db.c
diff --git
a/parser/src/pkgmgr_parser_db.c
b/parser/src/pkgmgr_parser_db.c
index
95f2472
..
74a8f47
100644
(file)
--- a/
parser/src/pkgmgr_parser_db.c
+++ b/
parser/src/pkgmgr_parser_db.c
@@
-474,6
+474,14
@@
static int __open_db(uid_t uid, const char *path, sqlite3 **db, int flags)
if (ret != SQLITE_OK)
return ret;
if (ret != SQLITE_OK)
return ret;
+ ret = sqlite3_busy_handler(*db, __db_busy_handler, NULL);
+ if (ret != SQLITE_OK) {
+ _LOGE("failed to register busy handler: %s",
+ sqlite3_errmsg(*db));
+ sqlite3_close_v2(*db);
+ return ret;
+ }
+
if (flags & SQLITE_OPEN_CREATE) {
ret = __initialize_db(*db, path, uid);
if (ret) {
if (flags & SQLITE_OPEN_CREATE) {
ret = __initialize_db(*db, path, uid);
if (ret) {
@@
-491,14
+499,6
@@
static int __open_db(uid_t uid, const char *path, sqlite3 **db, int flags)
return ret;
}
return ret;
}
- ret = sqlite3_busy_handler(*db, __db_busy_handler, NULL);
- if (ret != SQLITE_OK) {
- _LOGE("failed to register busy handler: %s",
- sqlite3_errmsg(*db));
- sqlite3_close_v2(*db);
- return ret;
- }
-
return ret;
}
return ret;
}