From 7421749f450d9845574a64476a7bebbf8555e8d7 Mon Sep 17 00:00:00 2001 From: spv Date: Wed, 24 Sep 2025 18:42:02 -0400 Subject: refactor, change timeout to 5s --- src/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 5c57bbf..f41ccfb 100644 --- a/src/main.c +++ b/src/main.c @@ -8,8 +8,8 @@ #include "consts.h" #include "config.h" -extern int light_thread(pid_t _keypress_pid); -extern int keypress_thread(pid_t _light_pid); +extern void light_thread(void); +extern void keypress_thread(pid_t _light_pid); struct timeval* last_press; @@ -34,8 +34,10 @@ int main(int argc, const char* argv[]) { setup(); pid_t keypress_pid = getpid(); - pid_t pid = fork(); + pid_t light_pid = fork(); - if (pid == 0) return light_thread(keypress_pid); - else return keypress_thread(/*light_*/pid); + if (light_pid == 0) light_thread(); + else keypress_thread(light_pid); + + return -1; } -- cgit v1.2.3