Skip to content
  • Philip Withnall's avatar
    f9a7ac11
    gstdio: Add support for the `e` flag (O_CLOEXEC) to g_fopen() · f9a7ac11
    Philip Withnall authored
    
    
    This adds cross-platform support for it: on glibc, musl and BSD’s libc,
    the flag is natively supported. On Windows, convert it to the `N` flag,
    which similarly indicates that an open file shouldn’t be inherited by
    child processes.
    
    This allows us to unconditionally pass `e` to `g_fopen()` so `O_CLOEXEC`
    can easily be set on its FDs.
    
    Also do the same for `g_freopen()`, since it shares the same underlying
    mode handling code.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    f9a7ac11
    gstdio: Add support for the `e` flag (O_CLOEXEC) to g_fopen()
    Philip Withnall authored
    
    
    This adds cross-platform support for it: on glibc, musl and BSD’s libc,
    the flag is natively supported. On Windows, convert it to the `N` flag,
    which similarly indicates that an open file shouldn’t be inherited by
    child processes.
    
    This allows us to unconditionally pass `e` to `g_fopen()` so `O_CLOEXEC`
    can easily be set on its FDs.
    
    Also do the same for `g_freopen()`, since it shares the same underlying
    mode handling code.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
Loading