From a44328438aa5bbe4c4927b584af18d7965e6794a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 10 Nov 2009 14:29:56 -0500 Subject: [svn-r17863] Description: Switch HSYS_GOTO_ERROR() & HSYS_DONE_ERROR() macros to use printf-like functionality for displaying system error messages. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- src/H5Eprivate.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index f951928..4c226d0 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -84,16 +84,13 @@ typedef struct H5E_t H5E_t; /* Retrieve the error code description string and push it onto the error * stack. */ -#define HSYS_ERROR(errnum) { \ - HERROR(H5E_INTERNAL, H5E_SYSERRSTR, HDstrerror(errnum)); \ -} #define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str) { \ - HSYS_ERROR(errno); \ - HDONE_ERROR(majorcode, minorcode, retcode, str); \ + int myerrno = errno; \ + HDONE_ERROR(majorcode, minorcode, retcode, "%s, errno = %d, error message = '%s'", str, myerrno, HDstrerror(myerrno)); \ } #define HSYS_GOTO_ERROR(majorcode, minorcode, retcode, str) { \ - HSYS_ERROR(errno); \ - HGOTO_ERROR(majorcode, minorcode, retcode, str); \ + int myerrno = errno; \ + HGOTO_ERROR(majorcode, minorcode, retcode, "%s, errno = %d, error message = '%s'", str, myerrno, HDstrerror(myerrno)); \ } #ifdef H5_HAVE_PARALLEL -- cgit v0.12