From b5973eba5dff22ca31080e337388b0df514bac91 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 20 Dec 1998 18:16:03 +0000 Subject: [PATCH] Minor change to signal handler. Changed _shutdown flag to type 'sig_atomic_t' and marked it volatile. Add detection to configure to ensure sig_atomic_t and volatile are supported. --- acconfig.h | 6 ++ build/openldap.m4 | 29 ++++++ configure | 208 +++++++++++++++++++++++++------------ configure.in | 2 + include/portable.h.in | 6 ++ servers/slapd/daemon.c | 1 + servers/slapd/main.c | 1 - servers/slapd/proto-slap.h | 1 - servers/slurpd/globals.h | 2 +- 9 files changed, 184 insertions(+), 72 deletions(-) diff --git a/acconfig.h b/acconfig.h index 686ef47bf9..660b27cc40 100644 --- a/acconfig.h +++ b/acconfig.h @@ -172,6 +172,12 @@ /* define this to use SLAPD shell backend */ #undef SLAPD_SHELL +/* define this to be empty if your compiler doesn't support volatile */ +#undef volatile + +/* define this if sig_atomic_t isn't defined in signal.h */ +#undef sig_atomic_t + /* These are defined in ldap_features.h */ /* LDAP_API_FEATURE_X_OPENLDAP_REENTRANT diff --git a/build/openldap.m4 b/build/openldap.m4 index 31439d60da..4b5aac9cba 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -394,3 +394,32 @@ if test $ol_cv_dcl_sys_errlist = no ; then AC_MSG_RESULT($ol_cv_have_sys_errlist) fi ])dnl + +dnl ==================================================================== +dnl Early MIPS compilers (used in Ultrix 4.2) don't like +dnl "int x; int *volatile a = &x; *a = 0;" +dnl -- borrowed from PDKSH +AC_DEFUN(OL_C_VOLATILE, + [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile, + [AC_TRY_COMPILE([int x, y, z;], + [volatile int a; int * volatile b = x ? &y : &z; + /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */ + *b = 0;], ol_cv_c_volatile=yes, ol_cv_c_volatile=no)]) + if test $ol_cv_c_volatile = yes; then + : + else + AC_DEFINE(volatile, ) + fi + ])dnl + +dnl ==================================================================== +dnl Define sig_atomic_t if not defined in signal.h +AC_DEFUN(OL_TYPE_SIG_ATOMIC_T, + [AC_CACHE_CHECK(for sig_atomic_t, ol_cv_type_sig_atomic_t, + [AC_TRY_COMPILE([#include ], [sig_atomic_t atomic;], + ol_cv_type_sig_atomic_t=yes, ol_cv_type_sig_atomic_t=no)]) + if test $ol_cv_type_sig_atomic_t = no; then + AC_DEFINE(sig_atomic_t, int) + fi + ])dnl + diff --git a/configure b/configure index 8fae424123..bf963c6675 100755 --- a/configure +++ b/configure @@ -6945,13 +6945,46 @@ cat >> confdefs.h <&6 +echo "configure:6950: checking for sig_atomic_t" >&5 +if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +sig_atomic_t atomic; +; return 0; } +EOF +if { (eval echo configure:6962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_type_sig_atomic_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_type_sig_atomic_t=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6 + if test $ol_cv_type_sig_atomic_t = no; then + cat >> confdefs.h <<\EOF +#define sig_atomic_t int +EOF + + fi + echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6950: checking for size_t" >&5 +echo "configure:6983: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6979,12 +7012,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:6983: checking for st_blksize in struct stat" >&5 +echo "configure:7016: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6992,7 +7025,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:6996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -7013,12 +7046,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:7017: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:7050: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7027,7 +7060,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:7031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -7048,12 +7081,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:7052: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:7085: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7061,7 +7094,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:7065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -7084,7 +7117,7 @@ fi echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 -echo "configure:7088: checking if toupper() requires islower()" >&5 +echo "configure:7121: checking if toupper() requires islower()" >&5 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7093,7 +7126,7 @@ else ol_cv_c_upper_lower=safe else cat > conftest.$ac_ext < @@ -7105,7 +7138,7 @@ main() exit(1); } EOF -if { (eval echo configure:7109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ol_cv_c_upper_lower=no else @@ -7128,12 +7161,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:7132: checking for working const" >&5 +echo "configure:7165: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -7202,6 +7235,43 @@ EOF fi +echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6 +echo "configure:7240: checking if compiler understands volatile" >&5 +if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_c_volatile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_c_volatile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_c_volatile" 1>&6 + if test $ol_cv_c_volatile = yes; then + : + else + cat >> confdefs.h <<\EOF +#define volatile +EOF + + fi + if test $cross_compiling = yes ; then cat >> confdefs.h <<\EOF @@ -7210,14 +7280,14 @@ EOF else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:7214: checking whether byte ordering is bigendian" >&5 +echo "configure:7284: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -7228,11 +7298,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -7243,7 +7313,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -7263,7 +7333,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -7300,7 +7370,7 @@ EOF fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:7304: checking size of short" >&5 +echo "configure:7374: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7308,7 +7378,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7319,7 +7389,7 @@ main() exit(0); } EOF -if { (eval echo configure:7323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -7339,7 +7409,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:7343: checking size of int" >&5 +echo "configure:7413: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7347,7 +7417,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7358,7 +7428,7 @@ main() exit(0); } EOF -if { (eval echo configure:7362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -7378,7 +7448,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:7382: checking size of long" >&5 +echo "configure:7452: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7386,7 +7456,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7397,7 +7467,7 @@ main() exit(0); } EOF -if { (eval echo configure:7401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -7419,7 +7489,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:7423: checking for 8-bit clean memcmp" >&5 +echo "configure:7493: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7427,7 +7497,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -7455,12 +7525,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:7459: checking for strftime" >&5 +echo "configure:7529: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -7505,7 +7575,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7509: checking for strftime in -lintl" >&5 +echo "configure:7579: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7513,7 +7583,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7551,12 +7621,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:7555: checking for vprintf" >&5 +echo "configure:7625: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -7603,12 +7673,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:7607: checking for _doprnt" >&5 +echo "configure:7677: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -7660,12 +7730,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7664: checking for $ac_func" >&5 +echo "configure:7734: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7715,7 +7785,7 @@ done fi echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:7719: checking for wait3 that fills in rusage" >&5 +echo "configure:7789: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7723,7 +7793,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -7754,7 +7824,7 @@ main() { } } EOF -if { (eval echo configure:7758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -7809,12 +7879,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7813: checking for $ac_func" >&5 +echo "configure:7883: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7871,12 +7941,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7875: checking for $ac_func" >&5 +echo "configure:7945: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7946,12 +8016,12 @@ fi for ac_func in getopt strdup tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7950: checking for $ac_func" >&5 +echo "configure:8020: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8004,13 +8074,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:8008: checking declaration of sys_errlist" >&5 +echo "configure:8078: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -8020,7 +8090,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -8041,20 +8111,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:8045: checking existence of sys_errlist" >&5 +echo "configure:8115: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index f33d501642..044407ac39 100644 --- a/configure.in +++ b/configure.in @@ -1102,6 +1102,7 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AM_TYPE_PTRDIFF_T AC_TYPE_SIGNAL +OL_TYPE_SIG_ATOMIC_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE AC_HEADER_TIME @@ -1109,6 +1110,7 @@ AC_STRUCT_TM OL_C_UPPER_LOWER AC_C_CONST +OL_C_VOLATILE if test $cross_compiling = yes ; then AC_DEFINE(CROSS_COMPILING, 1) diff --git a/include/portable.h.in b/include/portable.h.in index d2c7f0996d..597e5518fe 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -261,6 +261,12 @@ is provided ``as is'' without express or implied warranty. /* define this to use SLAPD shell backend */ #undef SLAPD_SHELL +/* define this to be empty if your compiler doesn't support volatile */ +#undef volatile + +/* define this if sig_atomic_t isn't defined in signal.h */ +#undef sig_atomic_t + /* These are defined in ldap_features.h */ /* LDAP_API_FEATURE_X_OPENLDAP_REENTRANT diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index d14f37eda4..3412fec5e4 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -36,6 +36,7 @@ int deny_severity = LOG_NOTICE; int dtblsize; Connection *c; +static volatile sig_atomic_t slapd_shutdown = 0; static void set_shutdown(int sig); static void do_nothing (int sig); diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 690da499d5..f81df898c3 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -24,7 +24,6 @@ int ldap_syslog; #endif int ldap_syslog_level = LOG_DEBUG; int udp; -int slapd_shutdown; char *default_referral; char *configfile; time_t starttime; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 87a570fb6d..cc9229e664 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -234,7 +234,6 @@ extern int global_schemacheck; extern int lber_debug; extern int ldap_syslog; extern int num_conns; -extern int slapd_shutdown; extern long num_bytes_sent; extern long num_entries_sent; extern long ops_completed; diff --git a/servers/slurpd/globals.h b/servers/slurpd/globals.h index 211c829ecd..365c32ed6c 100644 --- a/servers/slurpd/globals.h +++ b/servers/slurpd/globals.h @@ -29,7 +29,7 @@ typedef struct globals { /* How long the master slurpd sleeps when there's no work to do */ int no_work_interval; /* We keep running until slurpd_shutdown is nonzero. HUP signal set this */ - int slurpd_shutdown; + sig_atomic_t slurpd_shutdown; /* Number of replicas we're servicing */ int num_replicas; /* Array of pointers to replica info */ -- 2.39.5