Skip to content
Snippets Groups Projects
  • Simon McVittie's avatar
    8ed45a1a
    glnx-backports: Include `<glib-unix.h>` · 8ed45a1a
    Simon McVittie authored
    When compiling with GLib older than 2.80.x, we provide a compatibility
    backport of g_closefrom() and g_fdwalk_set_cloexec(), but when compiling
    with newer GLib, we rely on GLib to provide those.
    
    The intended scope of libglnx (Linux only) is narrower than the scope
    of `<glib-unix.h>` (any Unix platform), so we can safely include
    `<glib-unix.h>` unconditionally. This provides least-astonishment by
    having `#include <libglnx.h>` with newer GLib always provide a superset
    of the functionality it provides with older GLib.
    
    This would have avoided needing
    https://github.com/flatpak/flatpak/pull/5737
    
    .
    
    Fixes: 6ada39c3 "backports: Add a backport of g_closefrom(), g_fdwalk_set_cloexec()"
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
    8ed45a1a
    History
    glnx-backports: Include `<glib-unix.h>`
    Simon McVittie authored
    When compiling with GLib older than 2.80.x, we provide a compatibility
    backport of g_closefrom() and g_fdwalk_set_cloexec(), but when compiling
    with newer GLib, we rely on GLib to provide those.
    
    The intended scope of libglnx (Linux only) is narrower than the scope
    of `<glib-unix.h>` (any Unix platform), so we can safely include
    `<glib-unix.h>` unconditionally. This provides least-astonishment by
    having `#include <libglnx.h>` with newer GLib always provide a superset
    of the functionality it provides with older GLib.
    
    This would have avoided needing
    https://github.com/flatpak/flatpak/pull/5737
    
    .
    
    Fixes: 6ada39c3 "backports: Add a backport of g_closefrom(), g_fdwalk_set_cloexec()"
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>