mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Deal with lack of O_CLOEXEC
Some platforms don't have it. We fall back to fcntl() in other places, so do it here as well. https://bugzilla.gnome.org/show_bug.cgi?id=769042
This commit is contained in:
parent
ad669500a6
commit
d5efa64539
@ -33,6 +33,11 @@
|
||||
#ifndef O_PATH
|
||||
#define O_PATH 0
|
||||
#endif
|
||||
#ifndef O_CLOEXEC
|
||||
#define O_CLOEXEC 0
|
||||
#else
|
||||
#define HAVE_O_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
static GXdpDocuments *documents;
|
||||
static char *documents_mountpoint;
|
||||
@ -115,6 +120,10 @@ g_document_portal_add_document (GFile *file,
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifndef HAVE_O_CLOEXEC
|
||||
fcntl (fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
|
||||
fd_list = g_unix_fd_list_new ();
|
||||
fd_in = g_unix_fd_list_append (fd_list, fd, error);
|
||||
g_close (fd, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user