diff options
Diffstat (limited to 'src/light_thread.c')
| -rw-r--r-- | src/light_thread.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/light_thread.c b/src/light_thread.c index 20b7bb9..287932b 100644 --- a/src/light_thread.c +++ b/src/light_thread.c @@ -1,4 +1,4 @@ -// XXX signals, includes, open, write instead of fopen, fwrite +// XXX sigwait instead of signal handler... #include <stdio.h> @@ -34,20 +34,15 @@ void handler(int _) { backlight_off(); } else { backlight_on(); + usleep(BACKLIGHT_TIME); - handler(_); + raise(SIGCONT); } } -int light_thread(pid_t _keypress_pid) { - keypress_pid = _keypress_pid; - +void light_thread() { signal(SIGCONT, handler); - while (1) { - pause(); -// usleep(THREAD_WAIT); - } - - return 0; + for (;;) pause(); + __builtin_unreachable(); } |
