From: InHong Han Date: Mon, 24 Jul 2017 08:39:48 +0000 (+0900) Subject: Avoid duplicate fd_read requests to prevent broken pipe error X-Git-Tag: accepted/tizen/unified/20170726.135804~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F140306%2F3;p=platform%2Fcore%2Fuifw%2Fisf.git Avoid duplicate fd_read requests to prevent broken pipe error Change-Id: I5bcec8a95bc6c1b64db4b981b9d2b718f9071561 --- diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index 2d192c7..ca2b468 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -2045,9 +2045,13 @@ remote_surrounding_text_fd_read_func (void* data, Ecore_Fd_Handler* fd_handler) static void remote_surrounding_get (WSCContextISF *wsc_ctx) { + if (wsc_ctx && wsc_ctx->im_ctx && wsc_ctx->remote_surrounding_text_fd_read_handler) + return; + int filedes[2]; if (pipe2(filedes, O_CLOEXEC | O_NONBLOCK) == -1) { LOGW ("create pipe failed"); + return; } else { LOGD("%d,%d", filedes[0], filedes[1]); if (wsc_ctx && wsc_ctx->im_ctx) { @@ -2057,13 +2061,6 @@ remote_surrounding_get (WSCContextISF *wsc_ctx) close (filedes[1]); if (wsc_ctx && wsc_ctx->im_ctx) { - if (wsc_ctx->remote_surrounding_text_fd_read_handler) { - int fd = ecore_main_fd_handler_fd_get (wsc_ctx->remote_surrounding_text_fd_read_handler); - close (fd); - ecore_main_fd_handler_del (wsc_ctx->remote_surrounding_text_fd_read_handler); - wsc_ctx->remote_surrounding_text_fd_read_handler = NULL; - } - if (wsc_ctx->remote_surrounding_text) { free (wsc_ctx->remote_surrounding_text); wsc_ctx->remote_surrounding_text = NULL;