summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/instr-daemon.c b/instr-daemon.c
index a4265cf..4d65a54 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -240,9 +240,15 @@ int main(int argc, char **argv)
long timer_count;
long on_delay = (long)globals.Flash.turn_on_dly;
- if ((on_delay < 1) || (on_delay > 120)) {
- on_delay = 1;
+#define MIN_STARTUP_DELAY 2
+#define MAX_STARTUP_DELAY 120
+
+ if (on_delay < MIN_STARTUP_DELAY) {
+ on_delay = MIN_STARTUP_DELAY;
}
+ if (on_delay > MAX_STARTUP_DELAY) {
+ on_delay = MAX_STARTUP_DELAY;
+ }
while ((timer_count=sec_timer()-globals.Timers.startup_timer_value) < on_delay) {
message = g_strdup_printf ("%ld ", on_delay - timer_count);