summaryrefslogtreecommitdiffstats
path: root/src/H5E.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-03-25 21:31:06 (GMT)
committerGitHub <noreply@github.com>2022-03-25 21:31:06 (GMT)
commit15971fbd160ab061725f238379cc638ed37f05ef (patch)
tree1be26bd1be27c67ba674ddc39611d68959c3c207 /src/H5E.c
parentf73b4c618cb680f8be9b2f2510c34442ec24d713 (diff)
downloadhdf5-15971fbd160ab061725f238379cc638ed37f05ef.zip
hdf5-15971fbd160ab061725f238379cc638ed37f05ef.tar.gz
hdf5-15971fbd160ab061725f238379cc638ed37f05ef.tar.bz2
Hdf5 1 12 merges (#1528)
* Use internal version of H5Eprint2 to avoid possible stack overflow (#661) * Add support for parallel filters to h5repack (#832) * Allow parallel filters feature for comm size of 1 (#840) * Avoid popping API context when one wasn't pushed (#848) * Fix several warnings (#720) * Don't allow H5Pset(get)_all_coll_metadata_ops for DXPLs (#1201) * Fix free list tracking and cleanup cast alignment warnings (#1288) * Fix free list tracking and cleanup cast alignment warnings * Add free list tracking code to H5FL 'arr' routines * Fix usage of several HDfprintf format specifiers after HDfprintf removal (#1324) * Use appropriate printf format specifiers for haddr_t and hsize_t types directly (#1340) * Fix H5ACmpio dirty bytes creation debugging (#1357) * Fix documentation for H5D_space_status_t enum values (#1372) * Parallel rank0 deadlock fixes (#1183) * Fix several places where rank 0 can skip past collective MPI operations on failure * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix a few issues noted by LGTM (#1421) * Fix cache sanity checking code by moving functions to wider scope (#1435) * Fix metadata cache bug when resizing a pinned/protected entry (v2) (#1463) * Disable memory alloc sanity checks by default for Autotools debug builds (#1468) * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5E.c')
-rw-r--r--src/H5E.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/H5E.c b/src/H5E.c
index bcadd63..10d31f0 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -85,6 +85,7 @@ static H5E_t * H5E__get_current_stack(void);
static herr_t H5E__set_current_stack(H5E_t *estack);
static herr_t H5E__close_stack(H5E_t *err_stack);
static ssize_t H5E__get_num(const H5E_t *err_stack);
+static herr_t H5E__print2(hid_t err_stack, FILE *stream);
/*********************/
/* Package Variables */
@@ -325,10 +326,10 @@ H5E__set_default_auto(H5E_t *stk)
#endif /* H5_USE_16_API_DEFAULT */
stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1;
- stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5Eprint2;
+ stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5E__print2;
stk->auto_op.is_default = TRUE;
#else /* H5_NO_DEPRECATED_SYMBOLS */
- stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2;
+ stk->auto_op.func2 = (H5E_auto2_t)H5E__print2;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
stk->auto_data = NULL;
@@ -637,7 +638,7 @@ H5E__get_class_name(const H5E_cls_t *cls, char *name, size_t size)
/* Set the user's buffer, if provided */
if (name) {
- HDstrncpy(name, cls->cls_name, MIN((size_t)(len + 1), size));
+ HDstrncpy(name, cls->cls_name, size);
if ((size_t)len >= size)
name[size - 1] = '\0';
} /* end if */
@@ -1446,13 +1447,37 @@ done:
herr_t
H5Eprint2(hid_t err_stack, FILE *stream)
{
- H5E_t *estack; /* Error stack to operate on */
herr_t ret_value = SUCCEED; /* Return value */
/* Don't clear the error stack! :-) */
FUNC_ENTER_API_NOCLEAR(FAIL)
/*NO TRACE*/
+ /* Print error stack */
+ if ((ret_value = H5E__print2(err_stack, stream)) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Eprint2() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5E__print2
+ *
+ * Purpose: Internal helper routine for H5Eprint2.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5E__print2(hid_t err_stack, FILE *stream)
+{
+ H5E_t *estack; /* Error stack to operate on */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
/* Need to check for errors */
if (err_stack == H5E_DEFAULT) {
if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in
@@ -1472,8 +1497,8 @@ H5Eprint2(hid_t err_stack, FILE *stream)
HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack")
done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Eprint2() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5E__print2() */
/*-------------------------------------------------------------------------
* Function: H5Ewalk2