- neutrino: avoid some ifdef's; prioritize proc filesystem

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2017-11-13 21:17:36 +01:00
committed by Thilo Graf
parent 98e4d453be
commit 456c12dfb3

View File

@@ -2178,7 +2178,9 @@ void wake_up(bool &wakeup)
close(fd);
}
#endif
#if HAVE_ARM_HARDWARE
/* prioritize proc filesystem */
if (access("/proc/stb/fp/was_timer_wakeup", F_OK) == 0)
{
FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "r");
if (f)
{
@@ -2189,9 +2191,10 @@ void wake_up(bool &wakeup)
wakeup = (tmp > 0);
fclose(f);
}
#endif // HAVE_ARM_HARDWARE
}
/* not platform specific - this is created by the init process */
if (access("/tmp/.timer_wakeup", F_OK) == 0) {
else if (access("/tmp/.timer_wakeup", F_OK) == 0)
{
wakeup = 1;
unlink("/tmp/.timer_wakeup");
}
@@ -3949,7 +3952,9 @@ void CNeutrinoApp::ExitRun(int can_shutdown)
#endif
if (timer_minutes || leds)
{
#if HAVE_ARM_HARDWARE
/* prioritize proc filesystem */
if (access("/proc/stb/fp/was_timer_wakeup", F_OK) == 0)
{
FILE *f = fopen("/proc/stb/fp/wakeup_time","w");
if (f)
{
@@ -3963,7 +3968,10 @@ void CNeutrinoApp::ExitRun(int can_shutdown)
}
else
perror("fopen /proc/stb/fp/wakeup_time");
#else
}
/* not platform specific */
else
{
FILE *f = fopen("/tmp/.timer", "w");
if (f)
{
@@ -3975,7 +3983,7 @@ void CNeutrinoApp::ExitRun(int can_shutdown)
}
else
perror("fopen /tmp/.timer");
#endif
}
}
delete g_RCInput;