2006-07-15 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / libiberty / mkstemps.c
index 89b37d9f4805a4d1822f740603b86bf08c0a02bc..6c2e472528babdfd1da3d18afff2e7ba1beb0a2e 100644 (file)
@@ -49,6 +49,10 @@ typedef unsigned long gcc_uint64_t;
 #define TMP_MAX 16384
 #endif
 
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
 /*
 
 @deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})
@@ -119,7 +123,7 @@ mkstemps (char *pattern, int suffix_len)
       v /= 62;
       XXXXXX[5] = letters[v % 62];
 
-      fd = open (pattern, O_RDWR|O_CREAT|O_EXCL, 0600);
+      fd = open (pattern, O_BINARY|O_RDWR|O_CREAT|O_EXCL, 0600);
       if (fd >= 0)
        /* The file does not exist.  */
        return fd;
This page took 0.024221 seconds and 4 git commands to generate.