summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-02-28 23:57:58 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-01 00:37:19 +0200
commit3c06db79d32583c6953d503f547a4ac5d78e608b (patch)
tree73a3e1d1bcbf05e4fe29fbcdc8e751537dba7734
parent11359160bda78f09f595cb3ef81d1264c0e62494 (diff)
Open files from /assets (i.e. read-only) even if asked for write access
It seems to work better to silently "open" a such file read-only even if write access is requested, and let write attempts, if any, fail later. Otherwise loading a document from /assets fails with that idiotic "General Error" dialog... Change-Id: I95cbe18010ec5e75ee5993faef2656ae8a2f981b
-rw-r--r--sal/osl/unx/file.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index d1840a3ca72f..d3f6251b629b 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -859,11 +859,10 @@ SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_u
{
if (uFlags & osl_File_OpenFlag_Write)
{
- // Or should we just silently "open" it read-only and let write
- // attempts, if any, fail then later?
- OSL_TRACE("osl_openFile(%s, writeable), not possible!", cpFilePath);
- errno = EPERM;
- return osl_File_E_PERM;
+ // It seems to work better to silently "open" it read-only
+ // and let write attempts, if any, fail later. Otherwise
+ // loading a document from /assets fails with that idiotic
+ // "General Error" dialog...
}
void *address;
size_t size;