Skip to content

Commit 418b1fc

Browse files
committed
in case HDF5_VOL_CONNECTOR is set without value
1 parent 7e74466 commit 418b1fc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/e3sm_io.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ void check_connector_env(e3sm_io_config *cfg) {
3939
cfg->env_log_passthru = 1;
4040

4141
env_str = getenv("HDF5_VOL_CONNECTOR");
42-
if (env_str == NULL)
43-
/* env HDF5_VOL_CONNECTOR is not set */
42+
if (env_str == NULL || env_str[0] == '\0')
43+
/* env HDF5_VOL_CONNECTOR is not set or set with ni value */
4444
return;
4545

4646
if (strstr(env_str, "under_vol=512") != NULL || strstr(env_str, "async ") != NULL)
@@ -50,6 +50,8 @@ void check_connector_env(e3sm_io_config *cfg) {
5050

5151
env_str = strdup(env_str);
5252
char *connector = strtok(env_str, " \t\n\r");
53+
if (connector == NULL) return;
54+
5355
if (strcmp(connector, "LOG") == 0) {
5456
/* if LOG is set in HDF5_VOL_CONNECTOR */
5557
cfg->env_log = 1;

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ for API in "${APIS[@]}" ; do
137137
CMD="${RUN} ${EXEC} -k -a ${ap[0]} -r 2 -x ${ap[1]} -y 2 -o ${OUT_FILE} ${IN_FILE}"
138138
echo "CMD = ${CMD}"
139139
${CMD}
140+
140141
# run read operations (currently support pnetcdf, netcdf4 and canonical only)
141142
# Disable read for netcdf4 as it is extremely slow.
142143
if test "x${ap[1]}" = xcanonical && test "x${ap[0]}" == xpnetcdf ; then

0 commit comments

Comments
 (0)