1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed setting the 'Delta' parameter when calling the shutdown script with no active timer

This commit is contained in:
Klaus Schmidinger 2006-04-15 11:33:34 +02:00
parent 4ba450b737
commit b49df33917
3 changed files with 9 additions and 2 deletions

View File

@ -1830,3 +1830,7 @@ Tobias Grimm <listaccount@e-tobi.net>
Peter Dittmann <peter.dittmann@philips.com> Peter Dittmann <peter.dittmann@philips.com>
for a patch that was used as a base to implement cPlugin::Active() for a patch that was used as a base to implement cPlugin::Active()
Helge Lenz <h.lenz@gmx.de>
for reporting a bug in setting the 'Delta' parameter when calling the shutdown
script with no active timer

View File

@ -4526,3 +4526,5 @@ Video Disk Recorder Revision History
- The new function cPlugin::Active() can be used by a plugin to indicate that it - 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 is still busy and the system should not shut down or restart (based on a patch
from Peter Dittmann). See PLUGINS.html for details. 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).

5
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/vdr * 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 <getopt.h> #include <getopt.h>
@ -1132,7 +1132,8 @@ int main(int argc, char *argv[])
cControl::Shutdown(); cControl::Shutdown();
int Channel = timer ? timer->Channel()->Number() : 0; int Channel = timer ? timer->Channel()->Number() : 0;
const char *File = timer ? timer->File() : ""; 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; char *cmd;
asprintf(&cmd, "%s %ld %ld %d \"%s\" %d", Shutdown, Next, Delta, Channel, *strescape(File, "\"$"), UserShutdown); asprintf(&cmd, "%s %ld %ld %d \"%s\" %d", Shutdown, Next, Delta, Channel, *strescape(File, "\"$"), UserShutdown);
isyslog("executing '%s'", cmd); isyslog("executing '%s'", cmd);