From 4b7817e69e4168541b100d5732f69cd9e6704a2e Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Tue, 26 Mar 2013 16:31:56 +0000 Subject: [PATCH] Return EACCES instead of NC_EMETADATA when failing to create an HDF5 file --- cf | 5 ++--- libsrc/putget.c | 3 --- libsrc4/nc4file.c | 14 +++++++++----- libsrc4/nc4hdf.c | 1 - 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cf b/cf index 4d4d55d26..383b6dd5b 100644 --- a/cf +++ b/cf @@ -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" diff --git a/libsrc/putget.c b/libsrc/putget.c index f72a65b57..3add44aaf 100644 --- a/libsrc/putget.c +++ b/libsrc/putget.c @@ -23,9 +23,6 @@ #endif #include "nc3dispatch.h" -#if defined(_WIN32) || defined(_WIN64) -#include -#endif #undef MIN /* system may define MIN somewhere and complain */ #define MIN(mm,nn) (((mm) < (nn)) ? (mm) : (nn)) diff --git a/libsrc4/nc4file.c b/libsrc4/nc4file.c index 09b1befbb..2e6c5ec28 100644 --- a/libsrc4/nc4file.c +++ b/libsrc4/nc4file.c @@ -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 +#include "config.h" +#include /* netcdf functions sometimes return system errors */ +#include "nc.h" +#include "nc4internal.h" #include "nc4dispatch.h" -#include "ncdispatch.h" + +#include #ifdef USE_HDF4 #include @@ -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, "/", diff --git a/libsrc4/nc4hdf.c b/libsrc4/nc4hdf.c index 419558ece..ede5e957b 100644 --- a/libsrc4/nc4hdf.c +++ b/libsrc4/nc4hdf.c @@ -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);