summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/lcc/cpp/unix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/lcc/cpp/unix.c b/src/tools/lcc/cpp/unix.c
index bd879448..3e70b562 100644
--- a/src/tools/lcc/cpp/unix.c
+++ b/src/tools/lcc/cpp/unix.c
@@ -2,6 +2,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include "cpp.h"
extern int lcc_getopt(int, char *const *, const char *);
@@ -66,7 +67,12 @@ setup(int argc, char **argv)
error(FATAL, "Can't open input file %s", fp);
}
if (optind+1<argc) {
- int fdo = creat(argv[optind+1], 0666);
+ int fdo;
+#ifdef WIN32
+ fdo = creat(argv[optind+1], _S_IREAD | _S_IWRITE);
+#else
+ fdo = creat(argv[optind+1], 0666);
+#endif
if (fdo<0)
error(FATAL, "Can't open output file %s", argv[optind+1]);
dup2(fdo, 1);