summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Freitag <Thomas.Freitag@alfa.de>2013-09-21 10:10:16 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-09-21 10:11:22 +0200
commit1e612d331b79dabec66ad241d7ffe66674a10bc4 (patch)
tree94dcc0c040da6d9e3da217231b82673533ddb677
parentb8682d868ddf7f741e93b791588af0932893f95c (diff)
Windows: Fix CreateFile fails with ERROR_SHARING_VIOLATION
Bug #69597
-rw-r--r--goo/gfile.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/goo/gfile.cc b/goo/gfile.cc
index c590a193..44beddd5 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -24,6 +24,7 @@
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2013 Peter Breitenlohner <peb@mppmu.mpg.de>
+// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -621,7 +622,7 @@ Goffset GooFile::size() const {
GooFile* GooFile::open(const GooString *fileName) {
HANDLE handle = CreateFile(fileName->getCString(),
GENERIC_READ,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
@@ -632,7 +633,7 @@ GooFile* GooFile::open(const GooString *fileName) {
GooFile* GooFile::open(const wchar_t *fileName) {
HANDLE handle = CreateFileW(fileName,
GENERIC_READ,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);