aboutsummaryrefslogtreecommitdiffstats
path: root/mkstemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkstemp.c')
-rw-r--r--mkstemp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mkstemp.c b/mkstemp.c
index 07e1b0ef45..bc20510634 100644
--- a/mkstemp.c
+++ b/mkstemp.c
@@ -25,6 +25,10 @@
#include <errno.h>
#include <stdio.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -33,12 +37,13 @@
#include <unistd.h>
#endif
+#ifdef _WIN32
+#include <process.h> /* For spawning child process */
+#endif
+
#ifndef __set_errno
#define __set_errno(x) errno=(x)
#endif
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";