From 6fb0107c2fa909c4d8f566614a7a51669aa93de3 Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Thu, 8 Jan 2004 21:43:31 +0000 Subject: [PATCH] See ChangeLog entry 2004-01-08 16:45 UTC-0500 David G. Holm --- harbour/ChangeLog | 3 +++ harbour/source/rtl/filesys.c | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) 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; }