Commit f6214ddc authored by Christian Persch's avatar Christian Persch Committed by Germán Poo-Caamaño

libdocument: Fix ev_mkstemp

Add missing O_RDWR flag.

https://gitlab.gnome.org/GNOME/evince/issues/988
parent 9cc1f6c0
......@@ -20,6 +20,7 @@
#include <config.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
......@@ -34,6 +35,10 @@
static gchar *tmp_dir = NULL;
#ifndef O_BINARY
#define O_BINARY 0
#endif
/*
* ev_dir_ensure_exists:
* @dir: the directory name
......@@ -139,7 +144,7 @@ ev_mkstemp (const char *tmpl,
return -1;
name = g_build_filename (tmp, tmpl, NULL);
fd = g_mkstemp_full (name, O_CLOEXEC, 0600);
fd = g_mkstemp_full (name, O_RDWR | O_BINARY | O_CLOEXEC, 0600);
if (fd == -1) {
int errsv = errno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment