From 3b2421e6a7218b128c45ec2dd1f65a24d178093a Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 17 Nov 2021 21:30:20 +0800 Subject: [PATCH] Prevent subprocess hangs in xwidget * src/xwidget.c (Fmake_xwidget, Fxwidget_webkit_goto_url): Use `catch_child_signal' instead of trying to preserve the previous signal handler. --- src/xwidget.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xwidget.c b/src/xwidget.c index e1d54d43b74..e1bf40ea437 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -32,6 +32,7 @@ along with GNU Emacs. If not, see . */ #include "sysstdio.h" #include "termhooks.h" #include "window.h" +#include "process.h" /* Include xwidget bottom end headers. */ #ifdef USE_GTK @@ -189,14 +190,12 @@ fails. */) { xw->widget_osr = webkit_web_view_new (); + webkit_web_view_load_uri (WEBKIT_WEB_VIEW (xw->widget_osr), + "about:blank"); /* webkitgtk uses GSubprocess which sets sigaction causing Emacs to not catch SIGCHLD with its usual handle setup in 'catch_child_signal'. This resets the SIGCHLD sigaction. */ - struct sigaction old_action; - sigaction (SIGCHLD, NULL, &old_action); - webkit_web_view_load_uri (WEBKIT_WEB_VIEW (xw->widget_osr), - "about:blank"); - sigaction (SIGCHLD, &old_action, NULL); + catch_child_signal (); } else { @@ -1841,6 +1840,7 @@ DEFUN ("xwidget-webkit-goto-uri", uri = ENCODE_FILE (uri); #ifdef USE_GTK webkit_web_view_load_uri (WEBKIT_WEB_VIEW (xw->widget_osr), SSDATA (uri)); + catch_child_signal (); #elif defined NS_IMPL_COCOA nsxwidget_webkit_goto_uri (xw, SSDATA (uri)); #endif -- 2.39.2