1
0
mirror of https://gitlab.gnome.org/GNOME/evince synced 2024-07-02 15:48:59 +00:00

Windows: fix compilation, CLOEXEC does not exist

This commit is contained in:
Vincent Torri 2020-12-06 08:37:39 +01:00 committed by Germán Poo-Caamaño
parent 76afc32ded
commit dc631aa511

View File

@ -39,6 +39,11 @@ static gchar *tmp_dir = NULL;
#define O_BINARY 0
#endif
/* On Windows, O_CLOEXEC does not exist */
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
/*
* ev_dir_ensure_exists:
* @dir: the directory name
@ -513,6 +518,10 @@ static const char *compressor_cmds[] = {
static void
compression_child_setup_cb (gpointer fd_ptr)
{
#ifdef _WIN32
/* On Windows, processes are not inherited by default */
(void)fd_ptr;
#else
int fd = GPOINTER_TO_INT (fd_ptr);
int flags;
@ -521,6 +530,7 @@ compression_child_setup_cb (gpointer fd_ptr)
flags &= ~FD_CLOEXEC;
fcntl (fd, F_SETFD, flags);
}
#endif
}
static gchar *