mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
Use "e" mode flag in fopen () calls for race-free setting of the close-on-exec flag
All Unix CRTs examined: glibc, musl, BSDs, Apple libc, Android bionic ignore unknown fopen () mode flags, so this flag can be added unconditionally for Unix builds. Only Windows CRT is intolerant of these, so the single case in g_dbus_address_connect () where the fopen () call is shared between Unix and Windows needs appropriate platform-specific handling. Skipped the call sites in libcharset and xdgmime copylibs.
This commit is contained in:
committed by
Philip Withnall
parent
3f2e18b07c
commit
0e7bf99ec2
@@ -3166,7 +3166,7 @@ _resolve_dev_root (void)
|
||||
/* see if device with similar major:minor as /dev/root is mention
|
||||
* in /etc/mtab (it usually is)
|
||||
*/
|
||||
f = fopen ("/etc/mtab", "r");
|
||||
f = fopen ("/etc/mtab", "re");
|
||||
if (f != NULL)
|
||||
{
|
||||
struct mntent *entp;
|
||||
|
Reference in New Issue
Block a user