[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.
This commit is contained in:
dmh 2014-02-04 16:26:52 -07:00
parent 7786b78cfc
commit 0f4b72c53b
3 changed files with 12 additions and 22 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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();