Commit 8967e029 by Mark Shinwell Committed by Mark Shinwell

Open temporary files in binary mode when using mkstemps.

From-SVN: r114165
parent 96e5d745
2006-05-28 Mark Shinwell <shinwell@codesourcery.com>
* mkstemps.c: Open temporary files in binary mode.
2006-05-12 Anton Blanchard <anton@samba.org> 2006-05-12 Anton Blanchard <anton@samba.org>
* cplus-dem.c (demangle_fund_type): Ensure buf is large enough to * cplus-dem.c (demangle_fund_type): Ensure buf is large enough to
......
...@@ -49,6 +49,10 @@ typedef unsigned long gcc_uint64_t; ...@@ -49,6 +49,10 @@ typedef unsigned long gcc_uint64_t;
#define TMP_MAX 16384 #define TMP_MAX 16384
#endif #endif
#ifndef O_BINARY
# define O_BINARY 0
#endif
/* /*
@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len}) @deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})
...@@ -119,7 +123,7 @@ mkstemps (char *pattern, int suffix_len) ...@@ -119,7 +123,7 @@ mkstemps (char *pattern, int suffix_len)
v /= 62; v /= 62;
XXXXXX[5] = letters[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) if (fd >= 0)
/* The file does not exist. */ /* The file does not exist. */
return fd; return fd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment