From fb54bf78088bf1b195b3693609d2809e3b03ae9e Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 28 Jul 2019 13:43:01 -0600 Subject: [PATCH 1/3] removed unneeded setting of int_ncid by libhdf5 layer --- libhdf5/hdf5create.c | 11 ++++------- libhdf5/hdf5open.c | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 66fa0ac230..6ed3f13244 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -290,16 +290,13 @@ NC4_create(const char* path, int cmode, size_t initialsz, int basepe, hdf5_set_log_level(); #endif /* LOGGING */ - /* Check the cmode for validity. */ + /* Check the cmode for validity. Checking parallel against + * NC_DISKLESS already done in NC_create(). */ if((cmode & ILLEGAL_CREATE_FLAGS) != 0) - {res = NC_EINVAL; goto done;} - - /* check parallel against NC_DISKLESS already done in NC_create() */ - - nc_file->int_ncid = nc_file->ext_ncid; + return NC_EINVAL + /* Create the netCDF-4/HDF5 file. */ res = nc4_create_file(path, cmode, initialsz, parameters, nc_file); -done: return res; } diff --git a/libhdf5/hdf5open.c b/libhdf5/hdf5open.c index 1b11855290..009ca03f60 100644 --- a/libhdf5/hdf5open.c +++ b/libhdf5/hdf5open.c @@ -887,8 +887,6 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp, hdf5_set_log_level(); #endif /* LOGGING */ - nc_file->int_ncid = nc_file->ext_ncid; - /* Open the file. */ return nc4_open_file(path, mode, parameters, nc_file); } From 9d128c35b17dfb76f1f6d35a925c069861a91f0c Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 28 Jul 2019 13:52:05 -0600 Subject: [PATCH 2/3] comment fix --- libhdf5/hdf5create.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 6ed3f13244..8ee88cb8f7 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -27,9 +27,10 @@ extern int NC4_create_image_file(NC_FILE_INFO_T* h5, size_t); * * @param path The file name of the new file. * @param cmode The creation mode flag. - * @param initialsz The proposed initial file size (advisory) - * @param parameters extra parameter info (like MPI communicator) - * @param nc Pointer to an instance of NC. + * @param initialsz The proposed initial file size (advisory, for + * in-memory netCDF-4/HDF5 files only). + * @param parameters extra parameter info (like MPI communicator). + * @param nc Pointer to an already-existing instance of NC. * * @return ::NC_NOERR No error. * @return ::NC_EINVAL Invalid input (check cmode). From abfec2ee6e207d575172c47400ff6c242e2b0644 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 28 Jul 2019 15:48:25 -0600 Subject: [PATCH 3/3] adding missing semicolon --- libhdf5/hdf5create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 8ee88cb8f7..9c1c8e4607 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -294,7 +294,7 @@ NC4_create(const char* path, int cmode, size_t initialsz, int basepe, /* Check the cmode for validity. Checking parallel against * NC_DISKLESS already done in NC_create(). */ if((cmode & ILLEGAL_CREATE_FLAGS) != 0) - return NC_EINVAL + return NC_EINVAL; /* Create the netCDF-4/HDF5 file. */ res = nc4_create_file(path, cmode, initialsz, parameters, nc_file);