[svn-r4396] Purpose:

bug fix
Description:
    H5FD_mpio_flush() would try to file seek negative if the
    file->eoa is 0 (e.g., doing mpio on the raw-file of the
    split file driver).  Put in a code to catch this case
    by returning succeed immediately.
Platforms tested:
    modi4(pp)
This commit is contained in:
Albert Cheng 2001-08-20 13:36:58 -05:00
parent 701966ef0f
commit 82e12143f9

View File

@ -1542,6 +1542,9 @@ H5FD_mpio_flush(H5FD_t *_file)
* Unfortunately, keeping track of EOF is an expensive operation, so
* we can't just check whether EOF<EOA like with other drivers.
* Therefore we'll just read the byte at EOA-1 and then write it back. */
/* But if eoa is zero, then nothing to flush. Just return */
if (file->eoa == 0)
HRETURN(SUCCEED);
if (haddr_to_MPIOff(file->eoa-1, &mpi_off)<0) {
HRETURN_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
"cannot convert from haddr_t to MPI_Offset");