2009-08-11 12:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* source/rtl/fstemp.c
    ! Fixed regression in hb_fsCreateTemp() after 2009-08-07 11:55 UTC+0200
      where temp files couldn't be opened, instead a lot of temp filenames
      were created.
This commit is contained in:
Viktor Szakats
2009-08-11 10:02:00 +00:00
parent 169048432d
commit 99d8396f79
2 changed files with 19 additions and 6 deletions

View File

@@ -17,6 +17,12 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-08-11 12:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/fstemp.c
! Fixed regression in hb_fsCreateTemp() after 2009-08-07 11:55 UTC+0200
where temp files couldn't be opened, instead a lot of temp filenames
were created.
2009-08-11 11:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbtpathy/telepath.prg
! fixed tp_inkey() to not freeze when called without parameter

View File

@@ -267,13 +267,19 @@ HB_FHANDLE hb_fsCreateTemp( const char * pszDir, const char * pszPrefix, ULONG u
{
if( hb_fsTempName( pszName, pszDir, pszPrefix ) )
{
HB_FHANDLE fhnd = hb_fsCreateEx( pszName, ulAttr, FO_EXCLUSIVE | FO_EXCL );
#if defined( HB_OS_WIN )
/* Using FO_TRUNC on win platforms as hb_fsTempName() uses GetTempFileName(),
which creates the file, so FO_EXCL would fail at this point. [vszakats] */
HB_FHANDLE fhnd = hb_fsCreateEx( pszName, ulAttr, FO_EXCLUSIVE | FO_TRUNC );
#else
HB_FHANDLE fhnd = hb_fsCreateEx( pszName, ulAttr, FO_EXCLUSIVE | FO_EXCL );
#endif
/* This function may fail, if the generated filename got
used between generation and the file creation. */
/* This function may fail, if the generated filename got
used between generation and the file creation. */
if( fhnd != FS_ERROR )
return fhnd;
if( fhnd != FS_ERROR )
return fhnd;
}
else
{
@@ -285,7 +291,8 @@ HB_FHANDLE hb_fsCreateTemp( const char * pszDir, const char * pszPrefix, ULONG u
return FS_ERROR;
}
#else
#else /* HB_OS_UNIX */
HB_FHANDLE hb_fsCreateTemp( const char * pszDir, const char * pszPrefix, ULONG ulAttr, char * pszName )
{