Author: pebender
Date: Sun Nov 9 18:29:00 2008
New Revision: 3940
Modified:
trunk/gar-minimyth/html/minimyth/document-changelog.txt
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf.pm
Log:
- Fixed perl init bug that would cause init to hang sometimes when a
invalid variable value is encountered.
Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt Sun Nov 9
18:29:00 2008
@@ -51,6 +51,8 @@
- Fixed init so that MM_MEDIA_TV_URL does not need to be writable by
user 'minimyth' unless mythbackend is enabled
(MM_BACKEND_ENABLED='yes'),
but is must still be readable by user 'minimyth'.
+ - Fixed perl init bug that would cause init to hang sometimes when a
+ invalid variable value is encountered.
Modified build system
- Removed unneeded static libraries from the build system.
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf.pm
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf.pm
Sun Nov 9 18:29:00 2008
@@ -329,6 +329,23 @@
if ($valid == 0)
{
$minimyth->message_output('err', qq(error: $var_name=') .
$minimyth->var_get($var_name) . qq(' is not valid.));
+
+ # Replace the invalid value with the default value,
+ # so that dependent variables will get a valid value.
+ $minimyth->var_set($var_name, '');
+ if (defined $value_default)
+ {
+ if ($minimyth->var_get($var_name) eq '')
+ {
+ # Convert function pointer to its return value.
+ if (ref($value_default) eq 'CODE')
+ {
+ $value_default = &{$value_default}($minimyth,
$var_name);
+ }
+ # Set variable to its default value.
+ $minimyth->var_set($var_name, $value_default);
+ }
+ }
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---