// flush bool wxFile::Flush() { if ( IsOpened() ) { #if defined(__VISUALC__) || wxHAVE_FSYNC if ( wxFsync(m_fd) == -1 ) { wxLogSysError(_("can't flush file descriptor %d"), m_fd); return false; } #else // no fsync // just do nothing #endif // fsync } return true; }
// flush bool wxFile::Flush() { #ifdef HAVE_FSYNC // fsync() only works on disk files and returns errors for pipes, don't // call it then if ( IsOpened() && GetKind() == wxFILE_KIND_DISK ) { if ( CheckForError(wxFsync(m_fd)) ) { wxLogSysError(_("can't flush file descriptor %d"), m_fd); return false; } } #endif // HAVE_FSYNC return true; }