From 59866bea09c1433b9f527899d313cc37b49c4b73 Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Thu, 8 Jan 2004 21:20:30 +0000 Subject: [PATCH] 2004-01-08 16:00 UTC-0500 David G. Holm CVS: ---------------------------------------------------------------------- --- harbour/ChangeLog | 6 ++++++ harbour/source/rtl/filesys.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 760c870322..3a21a6b2de 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-01-08 16:00 UTC-0500 David G. Holm + * utils/hbpp/hbpp.c + ! Never include malloc.h, because: 1) It been obsoleted by stdlib.h + in Standard C; and 2) The use of malloc.h is forbidden in GCC 3.x + (I missed this one somehow during my earlier cleanup on 2003-12-10). + 2003-12-25 19:40 UTC-0800 Luis Krause Mantilla * include/hbapifs.ch * source/rtl/direct.c diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 09d26ab033..77c71145e4 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -1490,6 +1490,15 @@ void hb_fsCommit( FHANDLE hFileHandle ) /* faster - flushes data buffers only, without updating directory info */ s_uiErrorLast = ( fdatasync( hFileHandle ) < -1 ) ? FS_ERROR : 0; + if( s_uiErrorLast == EINVAL || s_uiErrorLast == ENOSYS ) + { + /* 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. + */ + s_uiErrorLast = ( fsync( hFileHandle ) < -1 ) ? FS_ERROR : 0; + } #else /* slower - flushes all file data buffers and i-node info */