diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 25 | ||||
-rw-r--r-- | sal/util/makefile.mk | 6 | ||||
-rw-r--r-- | sal/util/salalloc.list | 7 |
3 files changed, 26 insertions, 12 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 29edab385..61016f796 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -1013,18 +1013,6 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD return nRet; } - // read and lseek are used to check the possibility to access the data - // not a nice solution, but it allows to avoid a crash in case it is an opened samba file - // generally, reading of one byte should not affect the performance - char nCh; - if ( 1 != read( SourceFileFD, &nCh, 1 ) - || -1 == lseek( SourceFileFD, 0, SEEK_SET ) ) - { - nRet = errno; - (void) close( SourceFileFD ); - return nRet; - } - DestFileFD=open(pszDestFileName, O_WRONLY | O_CREAT, mode); if ( DestFileFD < 0 ) @@ -1043,6 +1031,19 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD return 0; } + // read and lseek are used to check the possibility to access the data + // not a nice solution, but it allows to avoid a crash in case it is an opened samba file + // generally, reading of one byte should not affect the performance + char nCh; + if ( 1 != read( SourceFileFD, &nCh, 1 ) + || -1 == lseek( SourceFileFD, 0, SEEK_SET ) ) + { + nRet = errno; + close( SourceFileFD ); + close( DestFileFD ); + return nRet; + } + size_t nWritten = 0; size_t nRemains = nSourceSize; diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index a43f09e2e..3247be877 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -160,6 +160,12 @@ SHL1STDLIBS+=-lcrypt .ENDIF .ENDIF +# #i105898# required for LD_PRELOAD libsalalloc_malloc.so +# if sal is linked with -Bsymbolic-functions +.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" +SHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list +.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" + SHL1LIBS+=$(SLB)$/$(TARGET).lib .IF "$(linkinc)" != "" diff --git a/sal/util/salalloc.list b/sal/util/salalloc.list new file mode 100644 index 000000000..303d225dd --- /dev/null +++ b/sal/util/salalloc.list @@ -0,0 +1,7 @@ +{ + rtl_allocateMemory; + rtl_reallocateMemory; + rtl_freeMemory; + rtl_allocateZeroMemory; + rtl_freeZeroMemory; +}; |