Open files with O_BINARY on windows. (#517140)

2008-02-18  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        * glocalfileoutputstream.c:
	Open files with O_BINARY on windows. (#517140)


svn path=/trunk/; revision=6531
This commit is contained in:
Alexander Larsson
2008-02-18 10:10:58 +00:00
committed by Alexander Larsson
parent ee9020e45e
commit b221d1b36d
3 changed files with 21 additions and 7 deletions

View File

@@ -46,6 +46,10 @@
#include <sys/mount.h>
#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
#if defined(HAVE_STATFS) && defined(HAVE_STATVFS)
/* Some systems have both statfs and statvfs, pick the
most "native" for these */
@@ -1110,7 +1114,7 @@ g_local_file_read (GFile *file,
int fd;
struct stat buf;
fd = g_open (local->filename, O_RDONLY, 0);
fd = g_open (local->filename, O_RDONLY|O_BINARY, 0);
if (fd == -1)
{
int errsv = errno;