diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2001-11-27 15:16:51 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2001-11-27 15:16:51 (GMT) |
commit | e4895fb48fbd64e6a753e350b1d9592335745431 (patch) | |
tree | 528d67b3a8a33e4ee4467ac588c7e7099529e267 /fortran | |
parent | 6da7ff594692052b3b928e68e0d1bf92db30761b (diff) | |
download | hdf5-e4895fb48fbd64e6a753e350b1d9592335745431.zip hdf5-e4895fb48fbd64e6a753e350b1d9592335745431.tar.gz hdf5-e4895fb48fbd64e6a753e350b1d9592335745431.tar.bz2 |
[svn-r4640]
Purpose:
Bug fix
Description:
Error messages were printed to the file and standard output regardless of the parameters passed to the h5eprint_f function. h5eprintc function did not close the file with the error output. Fixed.
Platforms tested:
arabica and eirene
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5Ef.c | 8 | ||||
-rw-r--r-- | fortran/src/H5Eff.f90 | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 57e4b19..ee3b621 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -36,7 +36,8 @@ nh5eclear_c( ) * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 - * Modifications: + * Modifications: Bug fix: Added call to close the file with the error messages + * EP 11/26/01 *---------------------------------------------------------------------------*/ int_f nh5eprint_c1(_fcd name, int_f* namelen) @@ -48,12 +49,15 @@ nh5eprint_c1(_fcd name, int_f* namelen) int c_namelen; c_namelen = *namelen; c_name = (char*)HD5f2cstring(name, c_namelen); - file = fopen(c_name, "w"); + file = fopen(c_name, "a"); + if(!file) return ret_val; /* * Call H5Eprint function. */ status = H5Eprint(file); + fclose(file); + if(status < 0) return ret_val; ret_val = 0; return ret_val; diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index 0c7b513..1d85ffc 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -110,8 +110,11 @@ END FUNCTION h5eprint_c2 END INTERFACE namelen = LEN(NAME) - if (present(name)) hdferr = h5eprint_c1(name, namelen) + if (present(name)) then + hdferr = h5eprint_c1(name, namelen) + else hdferr = h5eprint_c2() + endif END SUBROUTINE h5eprint_f !---------------------------------------------------------------------- |