Ticket #4524: 0001-x11-fix-Wdeprecated-declarations-for-g_module_build_.patch

File 0001-x11-fix-Wdeprecated-declarations-for-g_module_build_.patch, 1.4 KB (added by zaytsev, 3 months ago)
  • lib/tty/x11conn.c

    From 125b89961a0d388b75169c99a5574dbfcac47baa Mon Sep 17 00:00:00 2001
    From: "Yury V. Zaytsev" <yury@shurup.com>
    Date: Fri, 9 Aug 2024 07:31:04 +0200
    Subject: [PATCH] x11: fix `-Wdeprecated-declarations` for
     `g_module_build_path`
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    ```
    x11conn.c:140:5: warning: 'g_module_build_path' is deprecated [-Wdeprecated-declarations]
      140 |     x11_module_fname = g_module_build_path (NULL, "X11");
          |     ^~~~~~~~~~~~~~~~
    ```
    
    Reported-by: David Martín <dhmartina@yahoo.es>
    Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
    ---
     lib/tty/x11conn.c | 7 +------
     1 file changed, 1 insertion(+), 6 deletions(-)
    
    diff --git a/lib/tty/x11conn.c b/lib/tty/x11conn.c
    index cdb60f13f..fb471b90c 100644
    a b static gboolean 
    129129x11_available (void) 
    130130{ 
    131131#ifdef HAVE_GMODULE 
    132     gchar *x11_module_fname; 
    133  
    134132    if (lost_connection) 
    135133        return FALSE; 
    136134 
    137135    if (x11_module != NULL) 
    138136        return TRUE; 
    139137 
    140     x11_module_fname = g_module_build_path (NULL, "X11"); 
    141     x11_module = g_module_open (x11_module_fname, G_MODULE_BIND_LAZY); 
     138    x11_module = g_module_open ("X11", G_MODULE_BIND_LAZY); 
    142139    if (x11_module == NULL) 
    143140        x11_module = g_module_open ("libX11.so.6", G_MODULE_BIND_LAZY); 
    144141 
    145     g_free (x11_module_fname); 
    146  
    147142    if (x11_module == NULL) 
    148143        return FALSE; 
    149144