Return EACCES instead of NC_EMETADATA when failing to create an HDF5 file

This commit is contained in:
Dennis Heimbigner 2013-03-26 16:31:56 +00:00
parent 86eab350c2
commit 4b7817e69e
4 changed files with 11 additions and 12 deletions

5
cf
View File

@ -144,13 +144,12 @@ FLAGS="$FLAGS --disable-examples"
#FLAGS="$FLAGS --enable-dap-long-tests"
#FLAGS="$FLAGS --enable-ffio"
#FLAGS="$FLAGS --enable-benchmarks"
FLAGS="$FLAGS --enable-extra-tests"
FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --enable-extra-tests"
#FLAGS="$FLAGS --enable-large-file-tests"
#FLAGS="$FLAGS --disable-testsets"
#FLAGS="$FLAGS --disable-dap-remote-tests"
#FLAGS="$FLAGS --enable-doxygen"
FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --disable-diskless"
#FLAGS="$FLAGS --enable-mmap"
#FLAGS="$FLAGS --with-udunits"

View File

@ -23,9 +23,6 @@
#endif
#include "nc3dispatch.h"
#if defined(_WIN32) || defined(_WIN64)
#include <malloc.h>
#endif
#undef MIN /* system may define MIN somewhere and complain */
#define MIN(mm,nn) (((mm) < (nn)) ? (mm) : (nn))

View File

@ -8,12 +8,14 @@ Copyright 2003, University Corporation for Atmospheric Research. See
COPYRIGHT file for copying and redistribution conditions.
*/
#include "nc4internal.h"
#include "nc.h"
#include <H5DSpublic.h>
#include "config.h"
#include <errno.h> /* netcdf functions sometimes return system errors */
#include "nc.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include "ncdispatch.h"
#include <H5DSpublic.h>
#ifdef USE_HDF4
#include <mfhdf.h>
@ -326,7 +328,9 @@ nc4_create_file(const char *path, int cmode, MPI_Comm comm, MPI_Info info,
/* Create the file. */
if ((nc4_info->hdfid = H5Fcreate(path, flags, fcpl_id, fapl_id)) < 0)
BAIL(NC_EFILEMETA);
/*Change the return error from NC_EFILEMETADATA to
System error EACCES because that is the more likely problem */
BAIL(EACCES);
/* Open the root group. */
if ((nc4_info->root_grp->hdf_grpid = H5Gopen2(nc4_info->hdfid, "/",

View File

@ -2488,7 +2488,6 @@ nc4_rec_write_metadata(NC_GRP_INFO_T *grp, int bad_coord_order)
NC_GRP_INFO_T *child_grp;
int found_coord, coord_varid = -1, wrote_coord;
int last_dimid = -1;
int retval;
assert(grp && grp->name && grp->hdf_grpid);