Maintain a db connection in main.c for Remote pairing agent

This commit is contained in:
Julien BLACHE 2010-01-30 16:47:50 +01:00
parent dfa3db7732
commit b35c4749a2

View File

@ -602,6 +602,16 @@ main(int argc, char **argv)
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 */
ret = filescanner_init();
if (ret != 0)
@ -710,6 +720,7 @@ main(int argc, char **argv)
filescanner_deinit();
filescanner_fail:
db_perthread_deinit();
db_fail:
if (ret == EXIT_FAILURE)
{