diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a2a7dd3bb6..51044a4dd5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,9 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-01-08 16:45 UTC-0500 David G. Holm + * source/rtl/filesys.c + ! Usage of fdatasync updated to match current POSIX specification. 2004-01-08 16:00 UTC-0500 David G. Holm * source/rtl/filesys.c diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 77c71145e4..1814e1f958 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -1486,16 +1486,15 @@ void hb_fsCommit( FHANDLE hFileHandle ) /* NOTE: close() functions releases all lock regardles if it is an * original or duplicated file handle */ - #if defined(_POSIX_SYNCHRONIZED_IO) + #if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0) /* faster - flushes data buffers only, without updating directory info */ s_uiErrorLast = ( fdatasync( hFileHandle ) < -1 ) ? FS_ERROR : 0; - if( s_uiErrorLast == EINVAL || s_uiErrorLast == ENOSYS ) + if( s_uiErrorLast == EINVAL ) { - /* Either fdatasync is not supported in this POSIX implementation or - this implementation does not support synchronised I/O for this file, - so use the slower method that flushes all file data buffers and i-node - info for this file. + /* This implementation does not support synchronised I/O for + this file, so use the slower method that flushes all file + data buffers and i-node info for this file. */ s_uiErrorLast = ( fsync( hFileHandle ) < -1 ) ? FS_ERROR : 0; }