summaryrefslogtreecommitdiff
path: root/codemaker/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2003-10-22 10:04:37 +0000
committerOliver Bolte <obo@openoffice.org>2003-10-22 10:04:37 +0000
commit7587f410c9982dfb134ff2d583fcad9cabdc4864 (patch)
tree9b88bf5be7db30b184f425a1fae9f4a4ddb2b91f /codemaker/source
parent6a6571cddb2f589e75746cf3bd89ab42b55e9335 (diff)
#112751# change for unix only
Diffstat (limited to 'codemaker/source')
-rw-r--r--codemaker/source/codemaker/global.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx
index 2044e4feb95d..22fd6fbe99dd 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: global.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: obo $ $Date: 2003-10-22 09:23:30 $
+ * last change: $Author: obo $ $Date: 2003-10-22 11:04:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -335,8 +335,12 @@ FileStream::FileStream(const OString& name, FileAccessMode mode)
osl_File_Attribute_OthRead;
OUString sUrl(convertToFileUrl(name));
+#ifdef SAL_UNX
if (osl_openFile(sUrl.pData, &m_file, checkAccessMode(mode)) == osl_File_E_None &&
osl_setFileAttributes(sUrl.pData, uAttr) == osl_File_E_None)
+#else
+ if (osl_openFile(sUrl.pData, &m_file, checkAccessMode(mode)) == osl_File_E_None)
+#endif
m_name = name;
else
m_file = NULL;
@@ -375,12 +379,15 @@ void FileStream::createTempFile(const OString& sPath)
osl_File_Attribute_OthRead;
if (osl_createTempFile(sTmpPath.pData, &m_file, &sTmpName.pData) == osl_File_E_None) {
- if (osl_setFileAttributes(sTmpName.pData, uAttr) == osl_File_E_None) {
- OUString sSysTmpName;
- FileBase::getSystemPathFromFileURL(sTmpName, sSysTmpName);
- m_name = OUStringToOString(sSysTmpName, osl_getThreadTextEncoding());
- } else
+#ifdef SAL_UNX
+ if (osl_setFileAttributes(sTmpName.pData, uAttr) != osl_File_E_None) {
m_file = NULL;
+ return;
+ }
+#endif
+ OUString sSysTmpName;
+ FileBase::getSystemPathFromFileURL(sTmpName, sSysTmpName);
+ m_name = OUStringToOString(sSysTmpName, osl_getThreadTextEncoding());
} else
m_file = NULL;
}