LinuxTV Patchwork Crash on first start without setup.conf

login
register
mail settings
Submitter Juergen Lock
Date Dec. 9, 2011, 6:15 p.m.
Message ID <20111209181526.GA28594@triton8.kn-bremen.de>
Download mbox | patch
Permalink /patch/12912/
State New
Headers show

Comments

Juergen Lock - Dec. 9, 2011, 6:15 p.m.
Hi!

 (I'm still on 1.7.19 so forgive me if this already has been solved...)

 I just got a report that starting vdr without setup.conf crashes in
isnumber(Setup.InitialChannel) called from main() so I came up with
this bandaid fix:


 Is that ok or should cSetup::cSetup(void) in config.c be changed,
it doesn't initialize InitialChannel, there only is a comment:

  // InitialChannel is initialized by constructor

 Thanx,
	Juergen
Klaus Schmidinger - Dec. 10, 2011, 2:04 p.m.
On 09.12.2011 19:15, Juergen Lock wrote:
> Hi!
>
>   (I'm still on 1.7.19 so forgive me if this already has been solved...)

I forgive you ;-)

Actually it has been fixed in version 1.7.20, with an additional
fix in 1.7.21.

Klaus

>   I just got a report that starting vdr without setup.conf crashes in
> isnumber(Setup.InitialChannel) called from main() so I came up with
> this bandaid fix:
>
> --- vdr.c.orig
> +++ vdr.c
> @@ -735,6 +735,8 @@ int main(int argc, char *argv[])
>
>     if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT))
>        dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT);
> +  if (((const char *)Setup.InitialChannel) == NULL)
> +     Setup.InitialChannel = "0";
>     if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files
>        if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel)))
>           Setup.InitialChannel = Channel->GetChannelID().ToString();
>
>   Is that ok or should cSetup::cSetup(void) in config.c be changed,
> it doesn't initialize InitialChannel, there only is a comment:
>
>    // InitialChannel is initialized by constructor
>
>   Thanx,
> 	Juergen

Patch

--- vdr.c.orig
+++ vdr.c
@@ -735,6 +735,8 @@  int main(int argc, char *argv[])
 
   if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT))
      dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT);
+  if (((const char *)Setup.InitialChannel) == NULL)
+     Setup.InitialChannel = "0";
   if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files
      if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel)))
         Setup.InitialChannel = Channel->GetChannelID().ToString();

Privacy Policy