From b49df33917938bac6b57d7a122133cbe0b6b3d39 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 15 Apr 2006 11:33:34 +0200 Subject: [PATCH] Fixed setting the 'Delta' parameter when calling the shutdown script with no active timer --- CONTRIBUTORS | 4 ++++ HISTORY | 2 ++ vdr.c | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 8345303e..7d92a12a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1830,3 +1830,7 @@ Tobias Grimm Peter Dittmann for a patch that was used as a base to implement cPlugin::Active() + +Helge Lenz + for reporting a bug in setting the 'Delta' parameter when calling the shutdown + script with no active timer diff --git a/HISTORY b/HISTORY index facf7f1b..99746a95 100644 --- a/HISTORY +++ b/HISTORY @@ -4526,3 +4526,5 @@ Video Disk Recorder Revision History - The new function cPlugin::Active() can be used by a plugin to indicate that it is still busy and the system should not shut down or restart (based on a patch from Peter Dittmann). See PLUGINS.html for details. +- Fixed setting the 'Delta' parameter when calling the shutdown script with + no active timer (reported by Helge Lenz). diff --git a/vdr.c b/vdr.c index 1583f9da..f11088fb 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.257 2006/04/15 11:05:49 kls Exp $ + * $Id: vdr.c 1.258 2006/04/15 11:29:13 kls Exp $ */ #include @@ -1132,7 +1132,8 @@ int main(int argc, char *argv[]) cControl::Shutdown(); int Channel = timer ? timer->Channel()->Number() : 0; const char *File = timer ? timer->File() : ""; - Delta = Next - time(NULL); // compensates for Confirm() timeout + if (timer) + Delta = Next - time(NULL); // compensates for Confirm() timeout char *cmd; asprintf(&cmd, "%s %ld %ld %d \"%s\" %d", Shutdown, Next, Delta, Channel, *strescape(File, "\"$"), UserShutdown); isyslog("executing '%s'", cmd);