[gdm: 1/2] meson: set -D_GNU_SOURCE for updwtmpx




commit 95f946e314f1fcf8c4ccd4f3627fa0787d4344ef
Author: Sam James <sam gentoo org>
Date:   Tue Jul 5 01:47:35 2022 +0100

    meson: set -D_GNU_SOURCE for updwtmpx
    
    Without setting GNU_SOURCE, we end up getting:
    ```
    ../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did 
you mean ‘updwtmp’? [-Werror=implicit-function-declaration]
    updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
    ```
    
    This ended up exposing a bug in updwtmp(3) (which is now fixed
    thanks to the man-pages maintainers!) as it didn't mention that updwtmpx
    is a GNU extension (and hence needs GNU_SOURCE in order to be available).
    
    Alternatively, we could just #define _GNU_SOURCE in gdm-session-record.c
    for updwtmpx.
    
    Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216168

 meson.build | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/meson.build b/meson.build
index 845f673ec..2c4f00602 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,9 @@ i18n = import('i18n')
 # Compiler
 cc = meson.get_compiler('c')
 
+# Use GNU extensions if available
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
+
 # Options
 gdm_prefix = get_option('prefix')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]