From 0f4b72c53b1b38fdb4fee891075db1fa4d5301d1 Mon Sep 17 00:00:00 2001 From: dmh Date: Tue, 4 Feb 2014 16:26:52 -0700 Subject: [PATCH] [NCF-286]/e-support:JVN-123940 using cygwin64 causes a couple of bugs during make check. Fixes are as follows: 1. in ncdump.c and nccopy.c change all occurrences of 'return EXIT_FAILURE' and 'return EXIT_SUCCESS' with exit(EXIT_FAILURE) and exit(EXIT_SUCCESS) respectively. I have no idea why this works. 2. in libdap2/ncdap3a.c#freeNCDAPCOMMON, remove the call to nc_abort, it is causing a loop; not sure why this is not caught under other operating systems. --- libdap2/ncdap3a.c | 2 -- ncdump/nccopy.c | 10 +++++----- ncdump/ncdump.c | 22 +++++++--------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/libdap2/ncdap3a.c b/libdap2/ncdap3a.c index 012ec1747..6f2977c0c 100644 --- a/libdap2/ncdap3a.c +++ b/libdap2/ncdap3a.c @@ -31,8 +31,6 @@ freegetvara(Getvara* vara) NCerror freeNCDAPCOMMON(NCDAPCOMMON* dapcomm) { - /* abort the metadata file */ - (void)nc_abort(getncid(dapcomm)); freenccache(dapcomm,dapcomm->cdf.cache); nclistfree(dapcomm->cdf.projectedvars); nullfree(dapcomm->cdf.recorddimname); diff --git a/ncdump/nccopy.c b/ncdump/nccopy.c index d8a153457..3af31f07d 100644 --- a/ncdump/nccopy.c +++ b/ncdump/nccopy.c @@ -1381,16 +1381,16 @@ copy(char* infile, char* outfile) /* Check if any vars in -v don't exist */ if(missing_vars(igrp, option_nlvars, option_lvars)) - return EXIT_FAILURE; + exit(EXIT_FAILURE); if(option_nlgrps > 0) { if(inkind != NC_FORMAT_NETCDF4) { error("Group list (-g ...) only permitted for netCDF-4 file"); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } /* Check if any grps in -g don't exist */ if(grp_matches(igrp, option_nlgrps, option_lgrps, option_grpids) == 0) - return EXIT_FAILURE; + exit(EXIT_FAILURE); } if(option_write_diskless) @@ -1996,7 +1996,7 @@ main(int argc, char**argv) } if(copy(inputfile, outputfile) != NC_NOERR) - exit(1); - return 0; + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } END_OF_MAIN(); diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index df9b0ab50..db28c66fb 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -2189,11 +2189,7 @@ main(int argc, char *argv[]) if (argc <= 1) { usage(); -#ifdef vms - exit(EXIT_SUCCESS); -#else - return EXIT_SUCCESS; -#endif + exit(EXIT_SUCCESS); } while ((c = getopt(argc, argv, "b:cd:f:g:hikl:n:p:stv:xwK")) != EOF) @@ -2286,7 +2282,7 @@ main(int argc, char *argv[]) break; case '?': usage(); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } set_max_len(max_len); @@ -2298,7 +2294,7 @@ main(int argc, char *argv[]) if (argc != 1) { usage(); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } i = 0; @@ -2343,20 +2339,20 @@ main(int argc, char *argv[]) init_types(ncid); /* Check if any vars in -v don't exist */ if(missing_vars(ncid, formatting_specs.nlvars, formatting_specs.lvars)) - return EXIT_FAILURE; + exit(EXIT_FAILURE); if(formatting_specs.nlgrps > 0) { if(formatting_specs.nc_kind != NC_FORMAT_NETCDF4) { error("Group list (-g ...) only permitted for netCDF-4 file"); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } /* Check if any grps in -g don't exist */ if(grp_matches(ncid, formatting_specs.nlgrps, formatting_specs.lgrps, formatting_specs.grpids) == 0) - return EXIT_FAILURE; + exit(EXIT_FAILURE); } if (xml_out) { if(formatting_specs.nc_kind == NC_FORMAT_NETCDF4) { error("NcML output (-x) currently only permitted for netCDF classic model"); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } do_ncdumpx(ncid, path); } else { @@ -2367,10 +2363,6 @@ main(int argc, char *argv[]) } free(path); } -#ifdef vms exit(EXIT_SUCCESS); -#else - return EXIT_SUCCESS; -#endif } END_OF_MAIN();