1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fix parse error when O_BINARY is available.

This commit is contained in:
hniksic 2005-03-05 15:35:15 -08:00
parent 3a8f6494d7
commit c5ca8b7152
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (fopen_excl): Fix parse error when O_BINARY is
available.
2005-03-05 Hrvoje Niksic <hniksic@xemacs.org>
* url.c (url_file_name): Don't allow hosts named ".." to be

View File

@ -511,13 +511,14 @@ unique_create (const char *name, int binary, char **opened_name)
FILE *
fopen_excl (const char *fname, int binary)
{
int fd;
#ifdef O_EXCL
int flags = O_WRONLY | O_CREAT | O_EXCL;
# ifdef O_BINARY
if (binary)
flags |= O_BINARY
flags |= O_BINARY;
# endif
int fd = open (fname, flags, 0666);
fd = open (fname, flags, 0666);
if (fd < 0)
return NULL;
return fdopen (fd, binary ? "wb" : "w");