aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorspv <spv@spv.sh>2025-09-24 18:42:02 -0400
committerspv <spv@spv.sh>2025-09-24 18:42:02 -0400
commit7421749f450d9845574a64476a7bebbf8555e8d7 (patch)
treeb6b907daa22c6683f23ebeb1f0c1f3e3407ce4ea /src/main.c
parente87085400d4a46793ee4f21ea8591c0f65813ba6 (diff)
refactor, change timeout to 5s
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 7 insertions, 5 deletions
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;
}