Репозитории ALT
S: | 2.8.0-alt2 |
5.1: | 2.0.5-alt4 |
4.1: | 2.0.5-alt3 |
4.0: | 2.0.5-alt2 |
3.0: | 2.0.2-alt1 |
Группа :: Система/Серверы
Пакет: nut
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: nut-2.0.5-alt-megatec-shutdown.patch
Скачать
Скачать
2007-07-27 Sergey Vlasov <vsu@altlinux.org>
Fix megatec shutdown to use "ondelay" and "offdelay" from config.
* drivers/megatec.c:
(upsdrv_initinfo): Move "ondelay" and "offdelay" reading from here ...
(upsdrv_initups): ... to here.
--- nut-2.0.5/drivers/megatec.c.alt-megatec-shutdown 2007-07-27 14:30:47 +0400
+++ nut-2.0.5/drivers/megatec.c 2007-07-27 15:58:23 +0400
@@ -407,14 +407,6 @@ void upsdrv_initinfo(void)
}
}
- if (getval("ondelay")) {
- start_delay = CLAMP(atoi(getval("ondelay")), 0, MAX_START_DELAY);
- }
-
- if (getval("offdelay")) {
- shutdown_delay = CLAMP(atoi(getval("offdelay")), 0, MAX_SHUTDOWN_DELAY);
- }
-
/*
* Register the available variables.
*/
@@ -742,6 +734,14 @@ void upsdrv_banner(void)
void upsdrv_initups(void)
{
+ if (getval("ondelay")) {
+ start_delay = CLAMP(atoi(getval("ondelay")), 0, MAX_START_DELAY);
+ }
+
+ if (getval("offdelay")) {
+ shutdown_delay = CLAMP(atoi(getval("offdelay")), 0, MAX_SHUTDOWN_DELAY);
+ }
+
upsfd = ser_open(device_path);
ser_set_speed(upsfd, device_path, B2400);
}