00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "ad_ntfs.h"
00010
00011 void ADIOI_NTFS_Flush(ADIO_File fd, int *error_code)
00012 {
00013 int err;
00014 #ifndef PRINT_ERR_MSG
00015 static char myname[] = "ADIOI_GEN_FLUSH";
00016 #endif
00017
00018 err = (fd->access_mode & ADIO_RDONLY) ? TRUE : FlushFileBuffers(fd->fd_sys);
00019
00020 #ifdef PRINT_ERR_MSG
00021 *error_code = (err == TRUE) ? MPI_SUCCESS : MPI_ERR_UNKNOWN;
00022 #else
00023 if (err == FALSE) {
00024 *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
00025 myname, "I/O Error", "%s", strerror(errno));
00026 ADIOI_Error(MPI_FILE_NULL, *error_code, myname);
00027 }
00028 else *error_code = MPI_SUCCESS;
00029 #endif
00030 }