aboutsummaryrefslogtreecommitdiff
path: root/libiberty/mkstemps.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2006-05-28 17:49:15 +0000
committerDJ Delorie <dj@redhat.com>2006-05-28 17:49:15 +0000
commit069c63e246c5cfe7050ff223db625b87e07c019a (patch)
tree962cd275c92acbf1b64b98f38704624dffd26cb4 /libiberty/mkstemps.c
parent46ea248bcc124c1874e8783c5e4cd90dae6610a2 (diff)
downloadgdb-069c63e246c5cfe7050ff223db625b87e07c019a.zip
gdb-069c63e246c5cfe7050ff223db625b87e07c019a.tar.gz
gdb-069c63e246c5cfe7050ff223db625b87e07c019a.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/mkstemps.c')
-rw-r--r--libiberty/mkstemps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c
index 89b37d9..6c2e472 100644
--- a/libiberty/mkstemps.c
+++ b/libiberty/mkstemps.c
@@ -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;