455 if (seconds > 59) { |
456 if (seconds > 59) { |
456 seconds = 0; |
457 seconds = 0; |
457 minutes++; |
458 minutes++; |
458 } |
459 } |
459 |
460 |
460 fprintf(stdout, "%d seconds %d minutes %ld millis\n", seconds, minutes, millis()); |
461 //fprintf(stdout, "%d seconds %d minutes %ld millis\n", seconds, minutes, millis()); |
461 |
462 |
462 rc = device_in(unit->hlt_sensor.uuid, &temp); |
463 rc = device_in(unit->hlt_sensor.uuid, &temp); |
463 if (rc == DEVPRESENT_YES) { |
464 if (rc == DEVPRESENT_YES) { |
464 hltInput = temp / 1000.0; |
465 hltInput = temp / 1000.0; |
465 unit->hlt_sensor.state = 0; |
466 unit->hlt_sensor.state = 0; |
592 syslog(LOG_NOTICE, "Error reading configuration: halted"); |
595 syslog(LOG_NOTICE, "Error reading configuration: halted"); |
593 return 1; |
596 return 1; |
594 } |
597 } |
595 if (debug) |
598 if (debug) |
596 fprintf(stdout, "configuration loaded\n"); |
599 fprintf(stdout, "configuration loaded\n"); |
|
600 |
|
601 if (rdrecipes()) { |
|
602 fprintf(stderr, "Error reading recipes\n"); |
|
603 syslog(LOG_NOTICE, "Error reading recipes: halted"); |
|
604 return 1; |
|
605 } |
|
606 if (debug) |
|
607 fprintf(stdout, "recipes loaded\n"); |
597 |
608 |
598 /* |
609 /* |
599 * Catch all the signals we can, and ignore the rest. Note that SIGKILL can't be ignored |
610 * Catch all the signals we can, and ignore the rest. Note that SIGKILL can't be ignored |
600 * but that's live. This daemon should only be stopped by SIGTERM. |
611 * but that's live. This daemon should only be stopped by SIGTERM. |
601 * Don't catch SIGCHLD. |
612 * Don't catch SIGCHLD. |