mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
Replaces HDgetenv with getenv (#3599)
This commit is contained in:
parent
58f3d6664e
commit
a87ca572fe
4
src/H5.c
4
src/H5.c
@ -275,7 +275,7 @@ H5_init_library(void)
|
||||
|
||||
/* Debugging? */
|
||||
H5__debug_mask("-all");
|
||||
H5__debug_mask(HDgetenv("HDF5_DEBUG"));
|
||||
H5__debug_mask(getenv("HDF5_DEBUG"));
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -887,7 +887,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
|
||||
const char *s; /* Environment string for disabling version check */
|
||||
|
||||
/* Allow different versions of the header files and library? */
|
||||
s = HDgetenv("HDF5_DISABLE_VERSION_CHECK");
|
||||
s = getenv("HDF5_DISABLE_VERSION_CHECK");
|
||||
|
||||
if (s && isdigit(*s))
|
||||
disable_version_check = (unsigned int)strtol(s, NULL, 0);
|
||||
|
@ -143,7 +143,7 @@ H5AC_init(void)
|
||||
{
|
||||
const char *s; /* String for environment variables */
|
||||
|
||||
s = HDgetenv("H5_COLL_API_SANITY_CHECK");
|
||||
s = getenv("H5_COLL_API_SANITY_CHECK");
|
||||
if (s && isdigit(*s)) {
|
||||
long env_val = strtol(s, NULL, 0);
|
||||
H5_coll_api_sanity_check_g = (0 == env_val) ? false : true;
|
||||
|
@ -191,8 +191,8 @@ H5D_init(void)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter");
|
||||
|
||||
/* Retrieve the prefixes of VDS and external file from the environment variable */
|
||||
H5D_prefix_vds_env = HDgetenv("HDF5_VDS_PREFIX");
|
||||
H5D_prefix_ext_env = HDgetenv("HDF5_EXTFILE_PREFIX");
|
||||
H5D_prefix_vds_env = getenv("HDF5_VDS_PREFIX");
|
||||
H5D_prefix_ext_env = getenv("HDF5_EXTFILE_PREFIX");
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
@ -544,7 +544,7 @@ H5D__mpio_debug_init(void)
|
||||
memset(H5D_mpio_debug_flags_s, 0, sizeof(H5D_mpio_debug_flags_s));
|
||||
|
||||
/* Retrieve and parse the H5Dmpio debug string */
|
||||
debug_str = HDgetenv("H5D_mpio_Debug");
|
||||
debug_str = getenv("H5D_mpio_Debug");
|
||||
if (debug_str)
|
||||
H5D__mpio_parse_debug_str(debug_str);
|
||||
|
||||
|
@ -430,7 +430,7 @@ done:
|
||||
static inline const H5FD_core_fapl_t *
|
||||
H5FD__core_get_default_config(void)
|
||||
{
|
||||
char *driver = HDgetenv(HDF5_DRIVER);
|
||||
char *driver = getenv(HDF5_DRIVER);
|
||||
|
||||
if (driver) {
|
||||
if (!strcmp(driver, "core"))
|
||||
@ -462,7 +462,7 @@ H5FD_core_init(void)
|
||||
FUNC_ENTER_NOAPI_NOERR
|
||||
|
||||
/* Check the use disabled file locks environment variable */
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT"))
|
||||
ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */
|
||||
else if (lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1")))
|
||||
|
@ -203,7 +203,7 @@ H5FD_direct_init(void)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
/* Check the use disabled file locks environment variable */
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT"))
|
||||
ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */
|
||||
else if (lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1")))
|
||||
|
@ -244,7 +244,7 @@ H5FD_log_init(void)
|
||||
FUNC_ENTER_NOAPI_NOERR
|
||||
|
||||
/* Check the use disabled file locks environment variable */
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT"))
|
||||
ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */
|
||||
else if (lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1")))
|
||||
|
@ -280,7 +280,7 @@ H5FD_mpio_init(void)
|
||||
H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_t), false);
|
||||
|
||||
/* Check if MPI driver has been loaded dynamically */
|
||||
env = HDgetenv(HDF5_DRIVER);
|
||||
env = getenv(HDF5_DRIVER);
|
||||
if (env && !strcmp(env, "mpio")) {
|
||||
int mpi_initialized = 0;
|
||||
|
||||
@ -299,7 +299,7 @@ H5FD_mpio_init(void)
|
||||
const char *s; /* String for environment variables */
|
||||
|
||||
/* Allow MPI buf-and-file-type optimizations? */
|
||||
s = HDgetenv("HDF5_MPI_OPT_TYPES");
|
||||
s = getenv("HDF5_MPI_OPT_TYPES");
|
||||
if (s && isdigit(*s))
|
||||
H5FD_mpi_opt_types_g = (0 == strtol(s, NULL, 0)) ? false : true;
|
||||
|
||||
@ -308,7 +308,7 @@ H5FD_mpio_init(void)
|
||||
memset(H5FD_mpio_debug_flags_s, 0, sizeof(H5FD_mpio_debug_flags_s));
|
||||
|
||||
/* Retrieve MPI-IO debugging environment variable */
|
||||
s = HDgetenv("H5FD_mpio_Debug");
|
||||
s = getenv("H5FD_mpio_Debug");
|
||||
if (s)
|
||||
H5FD__mpio_parse_debug_str(s);
|
||||
#endif /* H5FDmpio_DEBUG */
|
||||
|
@ -2074,9 +2074,9 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *
|
||||
#endif
|
||||
|
||||
#ifdef H5_HAVE_WIN32_API
|
||||
ret = snprintf(awspath, 117, "%s/.aws/", HDgetenv("USERPROFILE"));
|
||||
ret = snprintf(awspath, 117, "%s/.aws/", getenv("USERPROFILE"));
|
||||
#else
|
||||
ret = snprintf(awspath, 117, "%s/.aws/", HDgetenv("HOME"));
|
||||
ret = snprintf(awspath, 117, "%s/.aws/", getenv("HOME"));
|
||||
#endif
|
||||
if (ret < 0 || (size_t)ret >= 117)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path");
|
||||
|
@ -204,7 +204,7 @@ H5FD_sec2_init(void)
|
||||
FUNC_ENTER_NOAPI_NOERR
|
||||
|
||||
/* Check the use disabled file locks environment variable */
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT"))
|
||||
ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */
|
||||
else if (lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1")))
|
||||
|
@ -225,7 +225,7 @@ H5FD_ioc_init(void)
|
||||
H5_SUBFILING_GOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register IOC VFD");
|
||||
|
||||
/* Check if IOC VFD has been loaded dynamically */
|
||||
env_var = HDgetenv(HDF5_DRIVER);
|
||||
env_var = getenv(HDF5_DRIVER);
|
||||
if (env_var && !strcmp(env_var, H5FD_IOC_NAME)) {
|
||||
int mpi_initialized = 0;
|
||||
int provided = 0;
|
||||
@ -1494,7 +1494,7 @@ H5FD__ioc_del(const char *name, hid_t fapl)
|
||||
"can't allocate config file name buffer");
|
||||
|
||||
/* Check if a prefix has been set for the configuration file name */
|
||||
prefix_env = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX);
|
||||
prefix_env = getenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX);
|
||||
|
||||
/* TODO: No support for subfile directory prefix currently */
|
||||
/* TODO: Possibly try loading config file prefix from file before deleting */
|
||||
|
@ -167,7 +167,7 @@ initialize_ioc_threads(void *_sf_context)
|
||||
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, (-1), "can't initialize IOC thread queue mutex");
|
||||
|
||||
/* Allow experimentation with the number of helper threads */
|
||||
if ((env_value = HDgetenv(H5FD_IOC_THREAD_POOL_SIZE)) != NULL) {
|
||||
if ((env_value = getenv(H5FD_IOC_THREAD_POOL_SIZE)) != NULL) {
|
||||
int value_check = atoi(env_value);
|
||||
if (value_check > 0) {
|
||||
thread_pool_size = (unsigned int)value_check;
|
||||
|
@ -585,7 +585,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi
|
||||
config_out->shared_cfg.stripe_size = H5FD_SUBFILING_DEFAULT_STRIPE_SIZE;
|
||||
config_out->shared_cfg.stripe_count = H5FD_SUBFILING_DEFAULT_STRIPE_COUNT;
|
||||
|
||||
if ((h5_require_ioc = HDgetenv("H5_REQUIRE_IOC")) != NULL) {
|
||||
if ((h5_require_ioc = getenv("H5_REQUIRE_IOC")) != NULL) {
|
||||
int value_check = atoi(h5_require_ioc);
|
||||
if (value_check == 0)
|
||||
config_out->require_ioc = false;
|
||||
|
@ -776,7 +776,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param
|
||||
new_context->sf_group_comm = MPI_COMM_NULL;
|
||||
|
||||
/* Check if a prefix has been set for the configuration file name */
|
||||
prefix_env = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX);
|
||||
prefix_env = getenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX);
|
||||
if (prefix_env) {
|
||||
if (NULL == (new_context->config_file_prefix = strdup(prefix_env)))
|
||||
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "couldn't copy config file prefix string");
|
||||
@ -851,7 +851,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param
|
||||
char *env_value = NULL;
|
||||
|
||||
/* Check for a subfiling stripe size setting from the environment */
|
||||
if ((env_value = HDgetenv(H5FD_SUBFILING_STRIPE_SIZE))) {
|
||||
if ((env_value = getenv(H5FD_SUBFILING_STRIPE_SIZE))) {
|
||||
long long stripe_size = -1;
|
||||
|
||||
errno = 0;
|
||||
@ -981,7 +981,7 @@ init_app_topology(int64_t sf_context_id, H5FD_subfiling_params_t *subfiling_conf
|
||||
case SELECT_IOC_ONE_PER_NODE: {
|
||||
if (comm_size > 1) {
|
||||
/* Check for an IOC-per-node value set in the environment */
|
||||
if ((env_value = HDgetenv(H5FD_SUBFILING_IOC_PER_NODE))) {
|
||||
if ((env_value = getenv(H5FD_SUBFILING_IOC_PER_NODE))) {
|
||||
errno = 0;
|
||||
ioc_select_val = strtol(env_value, NULL, 0);
|
||||
if ((ERANGE == errno)) {
|
||||
@ -1178,7 +1178,7 @@ static herr_t
|
||||
get_ioc_selection_criteria_from_env(H5FD_subfiling_ioc_select_t *ioc_selection_type, char **ioc_sel_info_str)
|
||||
{
|
||||
char *opt_value = NULL;
|
||||
char *env_value = HDgetenv(H5FD_SUBFILING_IOC_SELECTION_CRITERIA);
|
||||
char *env_value = getenv(H5FD_SUBFILING_IOC_SELECTION_CRITERIA);
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
assert(ioc_selection_type);
|
||||
@ -1821,7 +1821,7 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam
|
||||
"couldn't allocate space for subfiling filename");
|
||||
|
||||
/* Check for a subfile name prefix setting in the environment */
|
||||
if ((env_value = HDgetenv(H5FD_SUBFILING_SUBFILE_PREFIX))) {
|
||||
if ((env_value = getenv(H5FD_SUBFILING_SUBFILE_PREFIX))) {
|
||||
if (NULL == (sf_context->subfile_prefix = strdup(env_value)))
|
||||
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't copy subfile prefix value");
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ H5F__parse_file_lock_env_var(htri_t *use_locks)
|
||||
FUNC_ENTER_PACKAGE_NOERR
|
||||
|
||||
/* Check the file locking environment variable */
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && (!strcmp(lock_env_var, "FALSE") || !strcmp(lock_env_var, "0")))
|
||||
*use_locks = false; /* Override: Never use locks */
|
||||
else if (lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "BEST_EFFORT") ||
|
||||
@ -875,9 +875,9 @@ H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix_type, const c
|
||||
|
||||
/* Get the appropriate environment variable */
|
||||
if (H5F_PREFIX_VDS == prefix_type)
|
||||
env_prefix = HDgetenv("HDF5_VDS_PREFIX");
|
||||
env_prefix = getenv("HDF5_VDS_PREFIX");
|
||||
else if (H5F_PREFIX_ELINK == prefix_type)
|
||||
env_prefix = HDgetenv("HDF5_EXT_PREFIX");
|
||||
env_prefix = getenv("HDF5_EXT_PREFIX");
|
||||
else
|
||||
HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, NULL, "prefix type is not sensible");
|
||||
|
||||
|
@ -140,7 +140,7 @@ H5PL_init(void)
|
||||
* to ignore plugins. The special symbol H5PL_NO_PLUGIN (defined in
|
||||
* H5PLpublic.h) means we don't want to load plugins.
|
||||
*/
|
||||
if (NULL != (env_var = HDgetenv(HDF5_PLUGIN_PRELOAD)))
|
||||
if (NULL != (env_var = getenv(HDF5_PLUGIN_PRELOAD)))
|
||||
if (!strcmp(env_var, H5PL_NO_PLUGIN)) {
|
||||
H5PL_plugin_control_mask_g = 0;
|
||||
H5PL_allow_plugins_g = false;
|
||||
|
@ -248,7 +248,7 @@ H5PL__create_path_table(void)
|
||||
/* Retrieve paths from HDF5_PLUGIN_PATH if the user sets it
|
||||
* or from the default paths if it isn't set.
|
||||
*/
|
||||
env_var = HDgetenv(HDF5_PLUGIN_PATH);
|
||||
env_var = getenv(HDF5_PLUGIN_PATH);
|
||||
if (NULL == env_var)
|
||||
paths = H5MM_strdup(H5PL_DEFAULT_PATH);
|
||||
else
|
||||
|
@ -851,7 +851,7 @@ H5P__facc_set_def_driver(void)
|
||||
FUNC_ENTER_PACKAGE
|
||||
|
||||
/* Check if VFL driver environment variable is set */
|
||||
driver_env_var = HDgetenv(HDF5_DRIVER);
|
||||
driver_env_var = getenv(HDF5_DRIVER);
|
||||
|
||||
/* Only parse VFL driver string if it's set */
|
||||
if (driver_env_var && *driver_env_var) {
|
||||
@ -889,7 +889,7 @@ H5P__facc_set_def_driver(void)
|
||||
} /* end else */
|
||||
|
||||
/* Retrieve driver configuration string from environment variable, if set. */
|
||||
driver_config_env_var = HDgetenv(HDF5_DRIVER_CONFIG);
|
||||
driver_config_env_var = getenv(HDF5_DRIVER_CONFIG);
|
||||
|
||||
driver_prop.driver_id = driver_id;
|
||||
driver_prop.driver_info = NULL;
|
||||
|
@ -370,7 +370,7 @@ H5VL__set_def_conn(void)
|
||||
} /* end if */
|
||||
|
||||
/* Check for environment variable set */
|
||||
env_var = HDgetenv(HDF5_VOL_CONNECTOR);
|
||||
env_var = getenv(HDF5_VOL_CONNECTOR);
|
||||
|
||||
/* Only parse the string if it's set */
|
||||
if (env_var && *env_var) {
|
||||
|
@ -819,7 +819,7 @@ H5_mpio_get_file_sync_required(MPI_File fh, bool *file_sync_required)
|
||||
HGOTO_ERROR(H5E_LIB, H5E_CANTFREE, FAIL, "can't free MPI info");
|
||||
|
||||
/* Force setting the flag via env variable (temp solution before the flag is implemented in MPI) */
|
||||
sync_env_var = HDgetenv("HDF5_DO_MPI_FILE_SYNC");
|
||||
sync_env_var = getenv("HDF5_DO_MPI_FILE_SYNC");
|
||||
if (sync_env_var && (!strcmp(sync_env_var, "TRUE") || !strcmp(sync_env_var, "1")))
|
||||
*file_sync_required = true;
|
||||
if (sync_env_var && (!strcmp(sync_env_var, "FALSE") || !strcmp(sync_env_var, "0")))
|
||||
|
@ -694,9 +694,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
|
||||
#define HDgetdrive() 0
|
||||
#endif
|
||||
|
||||
#ifndef HDgetenv
|
||||
#define HDgetenv(S) getenv(S)
|
||||
#endif
|
||||
#ifndef HDgetpid
|
||||
#define HDgetpid() getpid()
|
||||
#endif
|
||||
|
@ -155,12 +155,12 @@ main(int argc, char **argv)
|
||||
seed = (unsigned)HDtime(NULL);
|
||||
srand(seed);
|
||||
|
||||
if (NULL == (test_path_prefix = HDgetenv(HDF5_API_TEST_PATH_PREFIX)))
|
||||
if (NULL == (test_path_prefix = getenv(HDF5_API_TEST_PATH_PREFIX)))
|
||||
test_path_prefix = "";
|
||||
|
||||
snprintf(H5_api_test_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix, TEST_FILE_NAME);
|
||||
|
||||
if (NULL == (vol_connector_string = HDgetenv(HDF5_VOL_CONNECTOR))) {
|
||||
if (NULL == (vol_connector_string = getenv(HDF5_VOL_CONNECTOR))) {
|
||||
printf("No VOL connector selected; using native VOL connector\n");
|
||||
vol_connector_name = "native";
|
||||
vol_connector_info = NULL;
|
||||
|
@ -121,7 +121,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
|
||||
/* The root task does the getenv call
|
||||
* and sends the result to the other tasks */
|
||||
if (mpi_rank == root) {
|
||||
env = HDgetenv(name);
|
||||
env = getenv(name);
|
||||
if (env) {
|
||||
len = (int)strlen(env);
|
||||
MPI_Bcast(&len, 1, MPI_INT, root, comm);
|
||||
@ -158,7 +158,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
|
||||
/* use original getenv */
|
||||
if (env)
|
||||
free(env);
|
||||
env = HDgetenv(name);
|
||||
env = getenv(name);
|
||||
} /* end if */
|
||||
|
||||
return env;
|
||||
@ -218,7 +218,7 @@ h5_get_libver_fapl(hid_t fapl)
|
||||
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
|
||||
|
||||
/* Get the environment variable, if it exists */
|
||||
env = HDgetenv("HDF5_LIBVER_BOUNDS");
|
||||
env = getenv("HDF5_LIBVER_BOUNDS");
|
||||
#ifdef HDF5_LIBVER_BOUNDS
|
||||
/* Use the environment variable, then the compile-time constant */
|
||||
if (!env)
|
||||
@ -280,7 +280,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
/* Determine if driver is set by environment variable. If it is,
|
||||
* only generate a suffix if fixing the filename for the superblock
|
||||
* file. */
|
||||
driver_env_var = HDgetenv(HDF5_DRIVER);
|
||||
driver_env_var = getenv(HDF5_DRIVER);
|
||||
if (driver_env_var && (H5P_DEFAULT == fapl) && subst_for_superblock)
|
||||
fapl = H5P_FILE_ACCESS_DEFAULT;
|
||||
|
||||
@ -334,7 +334,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
}
|
||||
else {
|
||||
if (HDgetenv(HDF5_NOCLEANUP))
|
||||
if (getenv(HDF5_NOCLEANUP))
|
||||
SetTestNoCleanup();
|
||||
}
|
||||
#endif
|
||||
@ -382,7 +382,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
* For serial:
|
||||
* First use the environment variable, then try the constant
|
||||
*/
|
||||
prefix = HDgetenv("HDF5_PREFIX");
|
||||
prefix = getenv("HDF5_PREFIX");
|
||||
|
||||
#ifdef HDF5_PREFIX
|
||||
if (!prefix)
|
||||
@ -404,8 +404,8 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
*/
|
||||
char *user, *login;
|
||||
|
||||
user = HDgetenv("USER");
|
||||
login = HDgetenv("LOGIN");
|
||||
user = getenv("USER");
|
||||
login = getenv("LOGIN");
|
||||
subdir = (user ? user : login);
|
||||
|
||||
if (subdir) {
|
||||
@ -503,7 +503,7 @@ h5_using_default_driver(const char *drv_name)
|
||||
assert(H5_DEFAULT_VFD == H5FD_SEC2);
|
||||
|
||||
if (!drv_name)
|
||||
drv_name = HDgetenv(HDF5_DRIVER);
|
||||
drv_name = getenv(HDF5_DRIVER);
|
||||
|
||||
if (drv_name)
|
||||
return (!strcmp(drv_name, "sec2") || !strcmp(drv_name, "nomatch"));
|
||||
|
@ -8260,7 +8260,7 @@ test_file(void)
|
||||
MESSAGE(5, ("Testing Low-Level File I/O\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -3571,7 +3571,7 @@ test_reference(void)
|
||||
MESSAGE(5, ("Testing References\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -16093,7 +16093,7 @@ test_select(void)
|
||||
MESSAGE(5, ("Testing Selections\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -2077,7 +2077,7 @@ test_swmr_write_big(bool newest_format)
|
||||
/* Skip this test if SWMR I/O is not supported for the VFD specified
|
||||
* by the environment variable.
|
||||
*/
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
if (!H5FD__supports_swmr_test(driver)) {
|
||||
SKIPPED();
|
||||
puts(" Test skipped due to VFD not supporting SWMR I/O.");
|
||||
|
@ -56,7 +56,7 @@ main(void)
|
||||
/* Skip this test if SWMR I/O is not supported for the VFD specified
|
||||
* by the environment variable.
|
||||
*/
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
if (!H5FD__supports_swmr_test(driver))
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
|
@ -94,7 +94,7 @@ main(void)
|
||||
TESTING("library shutdown with reference count > 1");
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -9918,7 +9918,7 @@ main(void)
|
||||
const char *envval = NULL;
|
||||
bool api_ctx_pushed = false; /* Whether API context pushed */
|
||||
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
|
||||
|
@ -7758,7 +7758,7 @@ main(void)
|
||||
int express_test;
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -2234,7 +2234,7 @@ main(void)
|
||||
/* Skip these tests if SWMR I/O is not supported for the VFD specified
|
||||
* by the environment variable.
|
||||
*/
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
if (!H5FD__supports_swmr_test(driver)) {
|
||||
puts("-- SKIPPED SWMR tests for SWMR-incompatible VFD --");
|
||||
continue;
|
||||
|
@ -627,7 +627,7 @@ main(void)
|
||||
int nerrors = 0;
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -15427,7 +15427,7 @@ main(void)
|
||||
int i;
|
||||
|
||||
/* Don't run this test using certain file drivers */
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
|
||||
|
@ -786,7 +786,7 @@ main(void)
|
||||
int i;
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -15963,7 +15963,7 @@ main(void)
|
||||
bool api_ctx_pushed = false; /* Whether API context pushed */
|
||||
|
||||
/* Don't run this test using certain file drivers */
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
|
||||
|
@ -63,7 +63,7 @@ main(void)
|
||||
bool contig_addr_vfd; /* Contiguous address vfd */
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -188,7 +188,7 @@ main(void)
|
||||
TEST_ERROR;
|
||||
|
||||
/* Check if the current VFD supports SWMR */
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
vfd_supports_swmr = H5FD__supports_swmr_test(driver);
|
||||
|
||||
/*************************************************/
|
||||
|
@ -236,7 +236,7 @@ main(void)
|
||||
PUTS_ERROR("bad vfd-dependent fapl");
|
||||
|
||||
/* Check if the current VFD supports SWMR */
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
vfd_supports_swmr = H5FD__supports_swmr_test(driver);
|
||||
|
||||
if (h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_vfd_compatible) < 0) {
|
||||
|
@ -146,7 +146,7 @@ main(int argc, char *argv[])
|
||||
* anything. */
|
||||
|
||||
/* Determine driver being used */
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
|
||||
if (envval == NULL || H5FD__supports_swmr_test(envval)) {
|
||||
if (test_flush() != SUCCEED)
|
||||
|
@ -467,7 +467,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
/* Determine if driver is set by environment variable. If it is,
|
||||
* only generate a suffix if fixing the filename for the superblock
|
||||
* file. */
|
||||
driver_env_var = HDgetenv(HDF5_DRIVER);
|
||||
driver_env_var = getenv(HDF5_DRIVER);
|
||||
if (driver_env_var && (H5P_DEFAULT == fapl) && subst_for_superblock)
|
||||
fapl = H5P_FILE_ACCESS_DEFAULT;
|
||||
|
||||
@ -526,7 +526,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
}
|
||||
else {
|
||||
if (HDgetenv(HDF5_NOCLEANUP))
|
||||
if (getenv(HDF5_NOCLEANUP))
|
||||
SetTestNoCleanup();
|
||||
}
|
||||
|
||||
@ -574,7 +574,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
* For serial:
|
||||
* First use the environment variable, then try the constant
|
||||
*/
|
||||
prefix = HDgetenv("HDF5_PREFIX");
|
||||
prefix = getenv("HDF5_PREFIX");
|
||||
|
||||
#ifdef HDF5_PREFIX
|
||||
if (!prefix)
|
||||
@ -596,8 +596,8 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
|
||||
*/
|
||||
char *user, *login;
|
||||
|
||||
user = HDgetenv("USER");
|
||||
login = HDgetenv("LOGIN");
|
||||
user = getenv("USER");
|
||||
login = getenv("LOGIN");
|
||||
subdir = (user ? user : login);
|
||||
|
||||
if (subdir) {
|
||||
@ -787,7 +787,7 @@ h5_get_libver_fapl(hid_t fapl)
|
||||
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
|
||||
|
||||
/* Get the environment variable, if it exists */
|
||||
env = HDgetenv("HDF5_LIBVER_BOUNDS");
|
||||
env = getenv("HDF5_LIBVER_BOUNDS");
|
||||
#ifdef HDF5_LIBVER_BOUNDS
|
||||
/* Use the environment variable, then the compile-time constant */
|
||||
if (!env)
|
||||
@ -925,7 +925,7 @@ h5_set_info_object(void)
|
||||
int ret_value = 0;
|
||||
|
||||
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
|
||||
if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
|
||||
if ((envp = getenv("HDF5_MPI_INFO")) != NULL) {
|
||||
char *next, *valp;
|
||||
|
||||
valp = envp = next = strdup(envp);
|
||||
@ -1088,7 +1088,7 @@ h5_get_file_size(const char *filename, hid_t fapl)
|
||||
h5_stat_size_t tot_size = 0;
|
||||
char *driver_env_var = NULL;
|
||||
|
||||
driver_env_var = HDgetenv(HDF5_DRIVER);
|
||||
driver_env_var = getenv(HDF5_DRIVER);
|
||||
if (driver_env_var && !strcmp(driver_env_var, "split")) {
|
||||
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
|
||||
if (mt != H5FD_MEM_DRAW && mt != H5FD_MEM_SUPER)
|
||||
@ -1302,7 +1302,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
|
||||
/* The root task does the getenv call
|
||||
* and sends the result to the other tasks */
|
||||
if (mpi_rank == root) {
|
||||
env = HDgetenv(name);
|
||||
env = getenv(name);
|
||||
if (env) {
|
||||
len = (int)strlen(env);
|
||||
MPI_Bcast(&len, 1, MPI_INT, root, comm);
|
||||
@ -1339,7 +1339,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
|
||||
/* use original getenv */
|
||||
if (env)
|
||||
free(env);
|
||||
env = HDgetenv(name);
|
||||
env = getenv(name);
|
||||
} /* end if */
|
||||
|
||||
return env;
|
||||
@ -1917,7 +1917,7 @@ H5_get_srcdir_filename(const char *filename)
|
||||
const char *
|
||||
H5_get_srcdir(void)
|
||||
{
|
||||
const char *srcdir = HDgetenv("srcdir");
|
||||
const char *srcdir = getenv("srcdir");
|
||||
|
||||
/* Check for using the srcdir from configure time */
|
||||
if (NULL == srcdir)
|
||||
@ -2076,7 +2076,7 @@ h5_using_default_driver(const char *drv_name)
|
||||
assert(H5_DEFAULT_VFD == H5FD_SEC2);
|
||||
|
||||
if (!drv_name)
|
||||
drv_name = HDgetenv(HDF5_DRIVER);
|
||||
drv_name = getenv(HDF5_DRIVER);
|
||||
|
||||
if (drv_name)
|
||||
return (!strcmp(drv_name, "sec2") || !strcmp(drv_name, "nomatch"));
|
||||
@ -2197,7 +2197,7 @@ h5_driver_uses_multiple_files(const char *drv_name, unsigned flags)
|
||||
bool ret_val = false;
|
||||
|
||||
if (!drv_name)
|
||||
drv_name = HDgetenv(HDF5_DRIVER);
|
||||
drv_name = getenv(HDF5_DRIVER);
|
||||
|
||||
if (drv_name) {
|
||||
if ((flags & H5_EXCLUDE_MULTIPART_DRIVERS) == 0) {
|
||||
|
@ -1579,7 +1579,7 @@ main(void)
|
||||
static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = "";
|
||||
const char *hdfs_namenode_name_env = NULL;
|
||||
|
||||
hdfs_namenode_name_env = HDgetenv("HDFS_TEST_NAMENODE_NAME");
|
||||
hdfs_namenode_name_env = getenv("HDFS_TEST_NAMENODE_NAME");
|
||||
if (hdfs_namenode_name_env == NULL || hdfs_namenode_name_env[0] == '\0') {
|
||||
strncpy(hdfs_namenode_name, "localhost", HDFS_NAMENODE_NAME_MAX_SIZE);
|
||||
}
|
||||
|
@ -22656,7 +22656,7 @@ main(void)
|
||||
const char *env_h5_drvr; /* File Driver value from environment */
|
||||
bool driver_is_default_compatible;
|
||||
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -61,7 +61,7 @@ external_link_env(hid_t fapl, bool new_format)
|
||||
else
|
||||
TESTING("external links via environment variable");
|
||||
|
||||
if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL)
|
||||
if ((envval = getenv("HDF5_EXT_PREFIX")) == NULL)
|
||||
envval = "nomatch";
|
||||
if (strcmp(envval, ".:tmp_links_env") != 0)
|
||||
TEST_ERROR;
|
||||
@ -149,7 +149,7 @@ main(void)
|
||||
int nerrors = 0; /* Error from tests */
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -9134,7 +9134,7 @@ main(void)
|
||||
bool api_ctx_pushed = false; /* Whether API context pushed */
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -17128,7 +17128,7 @@ main(void)
|
||||
bool same_file; /* Whether to run tests that only use one file */
|
||||
bool driver_is_default_compatible;
|
||||
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -1839,7 +1839,7 @@ main(void)
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -4918,7 +4918,7 @@ main(void)
|
||||
/* The onion VFD only supports the sec2 VFD under the hood, so skip this
|
||||
* test when the environment variable has been set to something else
|
||||
*/
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
if ((0 != strcmp(env_h5_drvr, "nomatch")) && (0 != strcmp(env_h5_drvr, "sec2"))) {
|
||||
|
@ -2072,7 +2072,7 @@ main(void)
|
||||
h5_reset();
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -466,7 +466,7 @@ main(void)
|
||||
hid_t fapl;
|
||||
const char *envval = NULL;
|
||||
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
/* QAK: should be able to use the core driver? */
|
||||
|
@ -1695,7 +1695,7 @@ main(void)
|
||||
* initialize test urls *
|
||||
************************/
|
||||
|
||||
bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL");
|
||||
bucket_url_env = getenv("HDF5_ROS3_TEST_BUCKET_URL");
|
||||
if (bucket_url_env == NULL || bucket_url_env[0] == '\0') {
|
||||
printf("WARNING: S3 bucket url is not defined in environment "
|
||||
"variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
|
||||
|
@ -2520,7 +2520,7 @@ main(void)
|
||||
s3_test_credentials_loaded = 1;
|
||||
}
|
||||
|
||||
bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL");
|
||||
bucket_url_env = getenv("HDF5_ROS3_TEST_BUCKET_URL");
|
||||
if (bucket_url_env == NULL || bucket_url_env[0] == '\0') {
|
||||
printf("WARNING: S3 bucket url is not defined in environment "
|
||||
"variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
|
||||
|
@ -2859,7 +2859,7 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_
|
||||
|
||||
/* The split and multi driver are not compatible with page buffering. No message since the other
|
||||
* cases aren't skipped. */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr && (!strcmp(env_h5_drvr, "split") || !strcmp(env_h5_drvr, "multi")))
|
||||
return 0;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ main(void)
|
||||
const char *env_h5_drvr; /* File Driver value from environment */
|
||||
bool contig_addr_vfd; /* Whether VFD used has a contiguous address space */
|
||||
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
/* Current VFD that does not support contiguous address space */
|
||||
|
@ -1381,7 +1381,7 @@ main(void)
|
||||
int nerrors = 0;
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -7742,7 +7742,7 @@ main(void)
|
||||
/* Skip this test if SWMR I/O is not supported for the VFD specified
|
||||
* by the environment variable.
|
||||
*/
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
if (!H5FD__supports_swmr_test(driver)) {
|
||||
printf("This VFD does not support SWMR I/O\n");
|
||||
return EXIT_SUCCESS;
|
||||
@ -7752,7 +7752,7 @@ main(void)
|
||||
* about file locking. File locking should be used unless explicitly
|
||||
* disabled.
|
||||
*/
|
||||
lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
|
||||
lock_env_var = getenv(HDF5_USE_FILE_LOCKING);
|
||||
if (lock_env_var && !strcmp(lock_env_var, "FALSE"))
|
||||
use_file_locking = false;
|
||||
else
|
||||
|
@ -445,7 +445,7 @@ GetTestExpress(void)
|
||||
#endif
|
||||
|
||||
/* Check if HDF5TestExpress is set to override the default level */
|
||||
env_val = HDgetenv("HDF5TestExpress");
|
||||
env_val = getenv("HDF5TestExpress");
|
||||
if (env_val) {
|
||||
if (strcmp(env_val, "0") == 0)
|
||||
express_val = 0;
|
||||
@ -633,8 +633,8 @@ void
|
||||
TestAlarmOn(void)
|
||||
{
|
||||
#ifdef H5_HAVE_ALARM
|
||||
char *env_val = HDgetenv("HDF5_ALARM_SECONDS"); /* Alarm environment */
|
||||
unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */
|
||||
char *env_val = getenv("HDF5_ALARM_SECONDS"); /* Alarm environment */
|
||||
unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */
|
||||
|
||||
/* Get the alarm value from the environment variable, if set */
|
||||
if (env_val != NULL)
|
||||
|
@ -80,7 +80,7 @@ main(int argc, char *argv[])
|
||||
TestSummary();
|
||||
|
||||
/* Clean up test files, if allowed */
|
||||
if (GetTestCleanup() && !HDgetenv(HDF5_NOCLEANUP))
|
||||
if (GetTestCleanup() && !getenv(HDF5_NOCLEANUP))
|
||||
TestCleanup();
|
||||
|
||||
/* Release test infrastructure */
|
||||
|
@ -8123,7 +8123,7 @@ test_file(void)
|
||||
MESSAGE(5, ("Testing Low-Level File I/O\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -3564,7 +3564,7 @@ test_reference(void)
|
||||
MESSAGE(5, ("Testing References\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -16057,7 +16057,7 @@ test_select(void)
|
||||
MESSAGE(5, ("Testing Selections\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -3716,7 +3716,7 @@ test_sohm(void)
|
||||
MESSAGE(5, ("Testing Shared Object Header Messages\n"));
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -131,7 +131,7 @@ main(int argc, char *argv[])
|
||||
TestSummary();
|
||||
|
||||
/* Clean up test files, if allowed */
|
||||
if (GetTestCleanup() && !HDgetenv(HDF5_NOCLEANUP))
|
||||
if (GetTestCleanup() && !getenv(HDF5_NOCLEANUP))
|
||||
TestCleanup();
|
||||
|
||||
/* Release test infrastructure */
|
||||
|
@ -12320,7 +12320,7 @@ main(void)
|
||||
bool driver_is_parallel;
|
||||
int nerrors = 0;
|
||||
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -331,7 +331,7 @@ main(void)
|
||||
bool driver_is_parallel;
|
||||
int nerrors = 0;
|
||||
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -5880,7 +5880,7 @@ main(void)
|
||||
* specific VFD to be set and HDF5_DRIVER being set can interfere
|
||||
* with that.
|
||||
*/
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr) {
|
||||
printf(" -- SKIPPED VFD tests because %s is set -- \n", HDF5_DRIVER);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
10
test/vol.c
10
test/vol.c
@ -2093,7 +2093,7 @@ test_async_vol_props(void)
|
||||
FAIL_STACK_ERROR;
|
||||
|
||||
/* Override possible environment variable & re-initialize default VOL connector */
|
||||
conn_env_str = HDgetenv(HDF5_VOL_CONNECTOR);
|
||||
conn_env_str = getenv(HDF5_VOL_CONNECTOR);
|
||||
if (conn_env_str) {
|
||||
if (NULL == (conn_env_str = strdup(conn_env_str)))
|
||||
TEST_ERROR;
|
||||
@ -2256,7 +2256,7 @@ test_vol_cap_flags(void)
|
||||
TEST_ERROR;
|
||||
|
||||
/* If using the native VOL by default, check flags again with H5P_DEFAULT */
|
||||
vol_env = HDgetenv(HDF5_VOL_CONNECTOR);
|
||||
vol_env = getenv(HDF5_VOL_CONNECTOR);
|
||||
if (!vol_env || (0 == strcmp(vol_env, "native"))) {
|
||||
H5VL_class_t *cls;
|
||||
hid_t connector_id;
|
||||
@ -2338,8 +2338,8 @@ test_get_vol_name(void)
|
||||
|
||||
TESTING("getting connector name");
|
||||
|
||||
conn_env_str = HDgetenv(HDF5_VOL_CONNECTOR);
|
||||
if (NULL == (conn_env_str = HDgetenv("HDF5_VOL_CONNECTOR")))
|
||||
conn_env_str = getenv(HDF5_VOL_CONNECTOR);
|
||||
if (NULL == (conn_env_str = getenv("HDF5_VOL_CONNECTOR")))
|
||||
conn_env_str = "native";
|
||||
|
||||
/* Skip the connectors other than the native and pass_through connector */
|
||||
@ -2629,7 +2629,7 @@ main(void)
|
||||
int nerrors = 0;
|
||||
|
||||
/* Get the VFD to use */
|
||||
env_h5_drvr = HDgetenv(HDF5_DRIVER);
|
||||
env_h5_drvr = getenv(HDF5_DRIVER);
|
||||
if (env_h5_drvr == NULL)
|
||||
env_h5_drvr = "nomatch";
|
||||
|
||||
|
@ -236,13 +236,13 @@ main(int argc, char **argv)
|
||||
|
||||
srand(seed);
|
||||
|
||||
if (NULL == (test_path_prefix = HDgetenv(HDF5_API_TEST_PATH_PREFIX)))
|
||||
if (NULL == (test_path_prefix = getenv(HDF5_API_TEST_PATH_PREFIX)))
|
||||
test_path_prefix = "";
|
||||
|
||||
snprintf(H5_api_test_parallel_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
PARALLEL_TEST_FILE_NAME);
|
||||
|
||||
if (NULL == (vol_connector_string = HDgetenv(HDF5_VOL_CONNECTOR))) {
|
||||
if (NULL == (vol_connector_string = getenv(HDF5_VOL_CONNECTOR))) {
|
||||
if (MAINPROCESS)
|
||||
printf("No VOL connector selected; using native VOL connector\n");
|
||||
vol_connector_name = "native";
|
||||
|
@ -121,7 +121,7 @@ main(int argc, char *argv[])
|
||||
TESTING("H5Fflush (part1)");
|
||||
|
||||
/* Don't run using the split VFD */
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
|
||||
|
@ -146,7 +146,7 @@ main(int argc, char *argv[])
|
||||
TESTING("H5Fflush (part2 with flush)");
|
||||
|
||||
/* Don't run using the split VFD */
|
||||
envval = HDgetenv(HDF5_DRIVER);
|
||||
envval = getenv(HDF5_DRIVER);
|
||||
if (envval == NULL)
|
||||
envval = "nomatch";
|
||||
|
||||
|
@ -2072,13 +2072,13 @@ parse_subfiling_env_vars(void)
|
||||
{
|
||||
char *env_value;
|
||||
|
||||
if (NULL != (env_value = HDgetenv(H5FD_SUBFILING_STRIPE_SIZE))) {
|
||||
if (NULL != (env_value = getenv(H5FD_SUBFILING_STRIPE_SIZE))) {
|
||||
stripe_size_g = strtoll(env_value, NULL, 0);
|
||||
if ((ERANGE == errno) || (stripe_size_g <= 0))
|
||||
stripe_size_g = -1;
|
||||
}
|
||||
|
||||
if (NULL != (env_value = HDgetenv(H5FD_SUBFILING_IOC_PER_NODE))) {
|
||||
if (NULL != (env_value = getenv(H5FD_SUBFILING_IOC_PER_NODE))) {
|
||||
ioc_per_node_g = strtol(env_value, NULL, 0);
|
||||
if ((ERANGE == errno) || (ioc_per_node_g <= 0))
|
||||
ioc_per_node_g = -1;
|
||||
@ -2092,13 +2092,13 @@ parse_subfiling_env_vars(void)
|
||||
ioc_per_node_g = node_local_size;
|
||||
}
|
||||
|
||||
if (NULL != (env_value = HDgetenv(H5FD_IOC_THREAD_POOL_SIZE))) {
|
||||
if (NULL != (env_value = getenv(H5FD_IOC_THREAD_POOL_SIZE))) {
|
||||
ioc_thread_pool_size_g = atoi(env_value);
|
||||
if (ioc_thread_pool_size_g <= 0)
|
||||
ioc_thread_pool_size_g = -1;
|
||||
}
|
||||
|
||||
if (NULL != (env_value = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX))) {
|
||||
if (NULL != (env_value = getenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX))) {
|
||||
assert(config_dir);
|
||||
|
||||
strncpy(config_dir, env_value, PATH_MAX);
|
||||
@ -2347,7 +2347,7 @@ main(int argc, char **argv)
|
||||
must_unset_ioc_thread_count_env = true;
|
||||
}
|
||||
|
||||
if (!(env_value = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX))) {
|
||||
if (!(env_value = getenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX))) {
|
||||
int rand_value = 0;
|
||||
|
||||
if (MAINPROCESS)
|
||||
|
@ -994,7 +994,7 @@ h5tools_getenv_update_hyperslab_bufsize(void)
|
||||
int ret_value = 1;
|
||||
|
||||
/* check if environment variable is set for the hyperslab buffer size */
|
||||
if (NULL != (env_str = HDgetenv("H5TOOLS_BUFSIZE"))) {
|
||||
if (NULL != (env_str = getenv("H5TOOLS_BUFSIZE"))) {
|
||||
errno = 0;
|
||||
hyperslab_bufsize_mb = strtol(env_str, (char **)NULL, 10);
|
||||
if (errno != 0 || hyperslab_bufsize_mb <= 0)
|
||||
|
@ -2529,7 +2529,7 @@ get_width(void)
|
||||
|
||||
/* Try to get it from the COLUMNS environment variable first since it's
|
||||
* value is sometimes wrong. */
|
||||
if ((s = HDgetenv("COLUMNS")) && *s && isdigit((int)*s))
|
||||
if ((s = getenv("COLUMNS")) && *s && isdigit((int)*s))
|
||||
width = (int)strtol(s, NULL, 0);
|
||||
|
||||
#if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG)
|
||||
|
@ -402,7 +402,7 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
|
||||
}
|
||||
|
||||
/* First use the environment variable and then try the constant */
|
||||
prefix = HDgetenv("HDF5_PARAPREFIX");
|
||||
prefix = getenv("HDF5_PARAPREFIX");
|
||||
|
||||
#ifdef HDF5_PARAPREFIX
|
||||
if (!prefix)
|
||||
@ -416,8 +416,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
|
||||
* directory instead. */
|
||||
char *user, *login, *subdir;
|
||||
|
||||
user = HDgetenv("USER");
|
||||
login = HDgetenv("LOGIN");
|
||||
user = getenv("USER");
|
||||
login = getenv("LOGIN");
|
||||
subdir = (user ? user : login);
|
||||
|
||||
if (subdir) {
|
||||
|
@ -736,7 +736,7 @@ h5_set_info_object(void)
|
||||
int ret_value = 0;
|
||||
|
||||
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
|
||||
if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
|
||||
if ((envp = getenv("HDF5_MPI_INFO")) != NULL) {
|
||||
char *next, *valp;
|
||||
|
||||
valp = envp = next = strdup(envp);
|
||||
@ -1215,7 +1215,7 @@ report_parameters(struct options *opts)
|
||||
fprintf(output, "Contiguous\n");
|
||||
|
||||
{
|
||||
char *prefix = HDgetenv("HDF5_PARAPREFIX");
|
||||
char *prefix = getenv("HDF5_PARAPREFIX");
|
||||
|
||||
fprintf(output, "rank %d: Env HDF5_PARAPREFIX=%s\n", rank, (prefix ? prefix : "not set"));
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
|
||||
}
|
||||
|
||||
/* First use the environment variable and then try the constant */
|
||||
prefix = HDgetenv("HDF5_PREFIX");
|
||||
prefix = getenv("HDF5_PREFIX");
|
||||
|
||||
#ifdef HDF5_PREFIX
|
||||
if (!prefix)
|
||||
@ -324,8 +324,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
|
||||
* directory instead. */
|
||||
char *user, *login, *subdir;
|
||||
|
||||
user = HDgetenv("USER");
|
||||
login = HDgetenv("LOGIN");
|
||||
user = getenv("USER");
|
||||
login = getenv("LOGIN");
|
||||
subdir = (user ? user : login);
|
||||
|
||||
if (subdir) {
|
||||
@ -1259,7 +1259,7 @@ do_cleanupfile(iotype iot, char *filename)
|
||||
goto done;
|
||||
|
||||
if (clean_file_g == -1)
|
||||
clean_file_g = (HDgetenv(HDF5_NOCLEANUP) == NULL) ? 1 : 0;
|
||||
clean_file_g = (getenv(HDF5_NOCLEANUP) == NULL) ? 1 : 0;
|
||||
|
||||
if (clean_file_g) {
|
||||
|
||||
|
@ -777,7 +777,7 @@ report_parameters(struct options *opts)
|
||||
}
|
||||
|
||||
{
|
||||
char *prefix = HDgetenv("HDF5_PREFIX");
|
||||
char *prefix = getenv("HDF5_PREFIX");
|
||||
|
||||
fprintf(output, "Env HDF5_PREFIX=%s\n", (prefix ? prefix : "not set"));
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ error(const char *fmt, ...)
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
if (!HDgetenv(HDF5_NOCLEANUP))
|
||||
if (!getenv(HDF5_NOCLEANUP))
|
||||
HDunlink(filename);
|
||||
free(filename);
|
||||
}
|
||||
@ -197,7 +197,7 @@ static void
|
||||
get_unique_name(void)
|
||||
{
|
||||
const char *prefix = NULL;
|
||||
const char *env = HDgetenv("HDF5_PREFIX");
|
||||
const char *env = getenv("HDF5_PREFIX");
|
||||
|
||||
if (env)
|
||||
prefix = env;
|
||||
|
@ -42,7 +42,7 @@ main(void)
|
||||
{
|
||||
char *driver = NULL;
|
||||
|
||||
driver = HDgetenv(HDF5_DRIVER);
|
||||
driver = getenv(HDF5_DRIVER);
|
||||
|
||||
if (H5FD__supports_swmr_test(driver))
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -1350,7 +1350,7 @@ main(int argc, char *argv[])
|
||||
sg_mpi_rank = rank;
|
||||
|
||||
#if 0
|
||||
env_var = HDgetenv("HDF5_H5DWALK_PRINT_CMDLINE");
|
||||
env_var = getenv("HDF5_H5DWALK_PRINT_CMDLINE");
|
||||
if (env_var) {
|
||||
int enable = atoi(env_var);
|
||||
if (enable) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user