aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/fontfile/filewr.c
diff options
context:
space:
mode:
authorMike DePaulo <mikedep333@gmail.com>2015-05-09 20:23:03 -0400
committerMike DePaulo <mikedep333@gmail.com>2015-05-09 20:23:03 -0400
commitc39af97542ef38620204d25d86939afe0758c05b (patch)
tree2905e03574fa479e4251822437b8a6afbf6fdbf9 /libXfont/src/fontfile/filewr.c
parent92a3547b90985e069e390f062efbef89da44b759 (diff)
parentbec4be4c48239613ed1c704ae71bf08754eef711 (diff)
downloadvcxsrv-c39af97542ef38620204d25d86939afe0758c05b.tar.gz
vcxsrv-c39af97542ef38620204d25d86939afe0758c05b.tar.bz2
vcxsrv-c39af97542ef38620204d25d86939afe0758c05b.zip
Merge branch 'release/external-1.17.0.0-x' into release/1.17.0.0-x
Diffstat (limited to 'libXfont/src/fontfile/filewr.c')
-rw-r--r--libXfont/src/fontfile/filewr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libXfont/src/fontfile/filewr.c b/libXfont/src/fontfile/filewr.c
index bcc7b1eda..859a0bec1 100644
--- a/libXfont/src/fontfile/filewr.c
+++ b/libXfont/src/fontfile/filewr.c
@@ -33,17 +33,19 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <X11/fonts/fntfilio.h>
#include <X11/Xos.h>
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
FontFilePtr
FontFileOpenWrite (const char *name)
{
int fd;
-#if defined(WIN32) || defined(__CYGWIN__)
- fd = open (name, O_CREAT|O_TRUNC|O_RDWR|O_BINARY, 0666);
-#else
- fd = creat (name, 0666);
-#endif
+ fd = open (name, O_CREAT|O_TRUNC|O_RDWR|O_BINARY|O_CLOEXEC, 0666);
if (fd < 0)
return 0;
return (FontFilePtr) BufFileOpenWrite (fd);