From: Po Lu Date: Wed, 17 Nov 2021 13:30:20 +0000 (+0800) Subject: Prevent subprocess hangs in xwidget X-Git-Tag: emacs-29.0.90~2852^2~229 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3b2421e6a7218b128c45ec2dd1f65a24d178093a;p=emacs.git 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. --- 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