e_input_inputs: prevent deadlock due to pipe write blocking
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 26 Apr 2024 05:38:09 +0000 (14:38 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 29 Apr 2024 01:14:22 +0000 (10:14 +0900)
Change-Id: If104eb7074263e501ec7d998556384571c43714a
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/bin/e_input_inputs.c

index 2220f5fa478c1196900f965a0940e421c46a19fe..cdefbb1aa09f57be5170bd5326728832a6edd24f 100644 (file)
@@ -12,6 +12,7 @@
 #include <libudev.h>
 
 #include <glib.h>
+#include <fcntl.h>
 
 #ifdef HAVE_SYSTEMD
 # include <systemd/sd-daemon.h>
@@ -1127,6 +1128,9 @@ EINTERN void e_input_thread_init()
      {
         g_input_backend->main_to_input_thread_pipe_fd[0] = main_to_input_thread_pipe_fd[0];
         g_input_backend->main_to_input_thread_pipe_fd[1] = main_to_input_thread_pipe_fd[1];
+
+        if (fcntl(g_input_backend->main_to_input_thread_pipe_fd[1], F_SETFL, O_NONBLOCK) < 0)
+          ERR("can't set pipe to NONBLOCK");
      }
 }