From a80aca73c43aebc2bd0de85c05c823b2b5cf2093 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 28 Sep 2010 08:23:05 +0000 Subject: [PATCH] * Have the C library figure out if DST is in effect or not when doing time conversions. --- tivo_commands.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tivo_commands.c b/tivo_commands.c index c7b1a74..7977d56 100644 --- a/tivo_commands.c +++ b/tivo_commands.c @@ -146,6 +146,7 @@ int callback(void *args, int argc, char **argv, char **azColName) { struct tm tm; memset(&tm, 0, sizeof(tm)); + tm.tm_isdst = -1; // Have libc figure out if DST is in effect or not strptime(date, "%Y-%m-%dT%H:%M:%S", &tm); ret = sprintf(str_buf, "0x%X", (unsigned int)mktime(&tm)); memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1); @@ -186,6 +187,7 @@ int callback(void *args, int argc, char **argv, char **azColName) { struct tm tm; memset(&tm, 0, sizeof(tm)); + tm.tm_isdst = -1; // Have libc figure out if DST is in effect or not strptime(date, "%Y-%m-%dT%H:%M:%S", &tm); ret = sprintf(str_buf, "0x%X", (unsigned int)mktime(&tm)); memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1); @@ -705,9 +707,11 @@ ProcessTiVoCommand(struct upnphttp * h, const char * orig_path) if( val ) detailItem = strtoll(basename(val), NULL, 10); } - else if( strcasecmp(key, "Format") == 0 ) + else if( strcasecmp(key, "Format") == 0 || // Only send XML + strcasecmp(key, "SerialNum") == 0 || // Unused for now + strcasecmp(key, "DoGenres") == 0 ) // Not sure what this is, so ignore it { - // Only send XML + ;; } else {