mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
Maintain a db connection in main.c for Remote pairing agent
This commit is contained in:
parent
dfa3db7732
commit
b35c4749a2
11
src/main.c
11
src/main.c
@ -602,6 +602,16 @@ main(int argc, char **argv)
|
|||||||
goto db_fail;
|
goto db_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Open a DB connection for the main thread */
|
||||||
|
ret = db_perthread_init();
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
DPRINTF(E_FATAL, L_MAIN, "Could not perform perthread DB init for main\n");
|
||||||
|
|
||||||
|
ret = EXIT_FAILURE;
|
||||||
|
goto db_fail;
|
||||||
|
}
|
||||||
|
|
||||||
/* Spawn file scanner thread */
|
/* Spawn file scanner thread */
|
||||||
ret = filescanner_init();
|
ret = filescanner_init();
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -710,6 +720,7 @@ main(int argc, char **argv)
|
|||||||
filescanner_deinit();
|
filescanner_deinit();
|
||||||
|
|
||||||
filescanner_fail:
|
filescanner_fail:
|
||||||
|
db_perthread_deinit();
|
||||||
db_fail:
|
db_fail:
|
||||||
if (ret == EXIT_FAILURE)
|
if (ret == EXIT_FAILURE)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user