diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-31 10:22:32 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-31 10:22:32 +0100 |
commit | 5e731865a6e85e234b6a8daed9c671acaa21e6c1 (patch) | |
tree | 596262807dca06e007ae9673c6f3f4ae18a2066e /vdr.c | |
parent | 4f67ade2dcac00d3807df19f18601ee2eb267818 (diff) | |
download | vdr-5e731865a6e85e234b6a8daed9c671acaa21e6c1.tar.gz vdr-5e731865a6e85e234b6a8daed9c671acaa21e6c1.tar.bz2 |
Making sure that timers and channels are only saved together
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.191 2004/10/31 09:35:55 kls Exp $ + * $Id: vdr.c 1.192 2004/10/31 10:17:23 kls Exp $ */ #include <getopt.h> @@ -540,11 +540,13 @@ int main(int argc, char *argv[]) dsyslog("max. latency time %d seconds", MaxLatencyTime); } } - // Handle channel modifications: - if (!Channels.BeingEdited()) { + // Handle channel and timer modifications: + if (!Channels.BeingEdited() && !Timers.BeingEdited()) { int modified = Channels.Modified(); static time_t ChannelSaveTimeout = 0; - if (modified == CHANNELSMOD_USER) + // Channels and timers need to be stored in a consistent manner, + // therefore if one of them is changed, we save both. + if (modified == CHANNELSMOD_USER || Timers.Modified()) ChannelSaveTimeout = 1; // triggers an immediate save else if (modified && !ChannelSaveTimeout) ChannelSaveTimeout = time(NULL) + CHANNELSAVEDELTA; |