From 5acaa2b7df0dd913e228f21ce09fc8c6a4df2784 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Wed, 13 May 2020 14:02:12 +0200 Subject: [PATCH] line savings --- hkd.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hkd.c b/hkd.c index 9e3470d..eb1d08e 100644 --- a/hkd.c +++ b/hkd.c @@ -59,12 +59,6 @@ int main (void) int *fds = NULL; update_descriptors_list(&fds, &fd_num); - // TODO: watch for events inside /dev/input and reload accordingly - // could use the epoll syscall or the inotify API (linux), - // event API (openbsd), kqueue syscall (BSD and macos), a separate - // process or some polling system inside the main loop to maintain - // portability across other *NIX derivatives, could also use libev - int event_watcher = inotify_init1(IN_NONBLOCK); if (event_watcher < 0) die("could not call inotify_init"); @@ -98,12 +92,10 @@ int main (void) goto mainloop_begin; } - static int i; static unsigned int prev_size; - prev_size = pb.size; if (ev_type.events == EPOLLIN) { - for (i = 0; i < fd_num; i++) { + for (int i = 0; i < fd_num; i++) { rb = read(fds[i], &event, sizeof(struct input_event)); if (rb != sizeof(struct input_event)) continue;