From 1cf7824fceddbb922c6797a0f651d3217478b318 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 31 Mar 2009 17:29:34 +0000 Subject: [PATCH] * Preserve SystemUpdateID across restarts. * Fix compile issue with TiVo support disabled. --- minidlna.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/minidlna.c b/minidlna.c index f6a4f3f..db7b170 100644 --- a/minidlna.c +++ b/minidlna.c @@ -623,6 +623,14 @@ main(int argc, char * * argv) char **result; int rows; sqlite3_busy_timeout(db, 5000); + if( sql_get_table(db, "SELECT UPDATE_ID from SETTINGS", &result, &rows, 0) == SQLITE_OK ) + { + if( rows ) + { + updateID = atoi(result[1]); + } + sqlite3_free_table(result); + } if( sql_get_table(db, "pragma user_version", &result, &rows, 0) == SQLITE_OK ) { if( atoi(result[1]) != DB_VERSION ) { @@ -883,7 +891,9 @@ shutdown: if (sudp >= 0) close(sudp); if (shttpl >= 0) close(shttpl); + #ifdef TIVO_SUPPORT if (sbeacon >= 0) close(sbeacon); + #endif if(SendSSDPGoodbye(snotify, n_lan_addr) < 0) {