hdf5/hdf5-1.6.6-signal.patch
2008-01-07 21:10:10 +00:00

46 lines
1.6 KiB
Diff

--- hdf5-1.6.5/src/H5detect.c.orig 2005-09-12 19:18:23.000000000 +0200
+++ hdf5-1.6.5/src/H5detect.c 2005-11-15 18:25:36.030721792 +0100
@@ -106,7 +106,7 @@
static void detect_C99_integers64(void);
static void detect_alignments(void);
static size_t align_g[] = {1, 2, 4, 8, 16};
-static jmp_buf jbuf_g;
+static sigjmp_buf jbuf_g;
/*-------------------------------------------------------------------------
@@ -360,7 +360,7 @@
void (*_handler2)(int) = signal(SIGSEGV, sigsegv_handler); \
\
_buf = (char*)malloc(sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
- if (setjmp(jbuf_g)) _ano++; \
+ if (sigsetjmp(jbuf_g, 1)) _ano++; \
if (_ano<NELMTS(align_g)) { \
*((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
_val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/ \
@@ -376,7 +376,7 @@
memcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
_val2 = *((TYPE*)(_buf+align_g[_ano])); \
if(_val!=_val2) \
- longjmp(jbuf_g, 1); \
+ siglongjmp(jbuf_g, 1); \
/* End Cray Check */ \
(INFO.align)=align_g[_ano]; \
} else { \
@@ -460,7 +460,7 @@
sigsegv_handler(int UNUSED signo)
{
signal(SIGSEGV, sigsegv_handler);
- longjmp(jbuf_g, 1);
+ siglongjmp(jbuf_g, 1);
}
@@ -485,7 +485,7 @@
sigbus_handler(int UNUSED signo)
{
signal(SIGBUS, sigbus_handler);
- longjmp(jbuf_g, 1);
+ siglongjmp(jbuf_g, 1);
}