From 3bf5c2a8381c9dac54c88c264091b94847abf1c3 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 15 Mar 2022 08:54:30 +0800 Subject: [PATCH] Stop relying on dynlib for PGTK interrupt input * src/pgtkterm.c (pgtk_term_init): Use dlopen and dlsym directly instead of dynlib functions. (bug#54378) --- src/pgtkterm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index abcf18e11df..9f9768cf2ab 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -36,6 +36,8 @@ along with GNU Emacs. If not, see . */ #include #include +#include + #include "lisp.h" #include "blockinput.h" #include "frame.h" @@ -47,7 +49,6 @@ along with GNU Emacs. If not, see . */ #include "fontset.h" #include "composite.h" #include "ccl.h" -#include "dynlib.h" #include "termhooks.h" #include "termopts.h" @@ -6545,8 +6546,8 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) static int x_initialized = 0; static unsigned x_display_id = 0; static char *initial_display = NULL; - static dynlib_handle_ptr *handle = NULL; char *dpy_name; + static void *handle = NULL; Lisp_Object lisp_dpy_name = Qnil; block_input (); @@ -6720,15 +6721,15 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) dpyinfo->connection = -1; if (!handle) - handle = dynlib_open (NULL); + handle = dlopen (NULL, RTLD_LAZY); #ifdef GDK_WINDOWING_X11 if (!strcmp (G_OBJECT_TYPE_NAME (dpy), "GdkX11Display") && handle) { void *(*gdk_x11_display_get_xdisplay) (GdkDisplay *) - = dynlib_sym (handle, "gdk_x11_display_get_xdisplay"); + = dlsym (handle, "gdk_x11_display_get_xdisplay"); int (*x_connection_number) (void *) - = dynlib_sym (handle, "XConnectionNumber"); + = dlsym (handle, "XConnectionNumber"); if (x_connection_number && gdk_x11_display_get_xdisplay) @@ -6742,7 +6743,7 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) { struct wl_display *wl_dpy = gdk_wayland_display_get_wl_display (dpy); int (*display_get_fd) (struct wl_display *) - = dynlib_sym (handle, "wl_display_get_fd"); + = dlsym (handle, "wl_display_get_fd"); if (display_get_fd) dpyinfo->connection = display_get_fd (wl_dpy); -- 2.39.5