aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/worker.c b/src/worker.c
index 8b2af56..725fad7 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -19,6 +19,7 @@
#include "run_queue.h"
#include "signal.h"
+#include <poll.h>
#include <stdlib.h>
#include <string.h>
@@ -107,10 +108,6 @@ static int worker_handle_run(const struct msg *request, UNUSED struct msg **resp
if (ret < 0)
goto free_output;
- /* Close the descriptor and remove it from the event loop.
- * poll(2) is too confusing, honestly. */
- ret = EVENT_LOOP_REMOVE;
-
free_output:
proc_output_free(&result);
@@ -214,8 +211,8 @@ int worker_main(struct worker *worker)
if (ret < 0)
return ret;
- ret = cmd_dispatcher_add_to_event_loop(worker->cmd_dispatcher, worker->event_loop,
- fd);
+ ret = event_loop_add_once(worker->event_loop, fd, POLLIN,
+ cmd_dispatcher_handle_event, worker->cmd_dispatcher);
if (ret < 0)
return ret;