mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 02:11:11 +02:00
- neutrino: don't write timerinfo's when exiting to reboot
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -3889,39 +3889,42 @@ void CNeutrinoApp::ExitRun(int exit_code)
|
|||||||
if (cs_get_revision() != 10)
|
if (cs_get_revision() != 10)
|
||||||
bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
||||||
#endif
|
#endif
|
||||||
if (timer_minutes)
|
if (exit_code != CNeutrinoApp::EXIT_REBOOT)
|
||||||
{
|
{
|
||||||
time_t t = timer_minutes * 60;
|
if (timer_minutes)
|
||||||
struct tm *tm = localtime(&t);
|
|
||||||
char date[30];
|
|
||||||
strftime(date, sizeof(date), "%c", tm);
|
|
||||||
printf("timer_wakeup: %s (%ld)\n", date, timer_minutes * 60);
|
|
||||||
|
|
||||||
/* prioritize proc filesystem */
|
|
||||||
if (access("/proc/stb/fp/wakeup_time", F_OK) == 0)
|
|
||||||
{
|
{
|
||||||
FILE *f = fopen("/proc/stb/fp/wakeup_time","w");
|
time_t t = timer_minutes * 60;
|
||||||
if (f)
|
struct tm *tm = localtime(&t);
|
||||||
{
|
char date[30];
|
||||||
fprintf(f, "%ld\n", timer_minutes * 60);
|
strftime(date, sizeof(date), "%c", tm);
|
||||||
fclose(f);
|
printf("timer_wakeup: %s (%ld)\n", date, timer_minutes * 60);
|
||||||
}
|
|
||||||
else
|
|
||||||
perror("fopen /proc/stb/fp/wakeup_time");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* not platform specific */
|
/* prioritize proc filesystem */
|
||||||
FILE *f = fopen("/tmp/.timer", "w");
|
if (access("/proc/stb/fp/wakeup_time", F_OK) == 0)
|
||||||
if (f)
|
{
|
||||||
{
|
FILE *f = fopen("/proc/stb/fp/wakeup_time","w");
|
||||||
fprintf(f, "%ld\n", timer_minutes ? timer_minutes * 60 : 0);
|
if (f)
|
||||||
fprintf(f, "%d\n", leds);
|
{
|
||||||
fprintf(f, "%d\n", bright);
|
fprintf(f, "%ld\n", timer_minutes * 60);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
perror("fopen /proc/stb/fp/wakeup_time");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* not platform specific */
|
||||||
|
FILE *f = fopen("/tmp/.timer", "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf(f, "%ld\n", timer_minutes ? timer_minutes * 60 : 0);
|
||||||
|
fprintf(f, "%d\n", leds);
|
||||||
|
fprintf(f, "%d\n", bright);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
perror("fopen /tmp/.timer");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
perror("fopen /tmp/.timer");
|
|
||||||
|
|
||||||
delete g_RCInput;
|
delete g_RCInput;
|
||||||
g_RCInput = NULL;
|
g_RCInput = NULL;
|
||||||
|
Reference in New Issue
Block a user