From 86a733bc740498896453a70399d9e7220127f92a Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Sat, 14 Jul 2001 01:55:08 +0000 Subject: [PATCH] use ISC_PLATFORM_RLIMITTYPE unconditionally, eliminating the need for the HAVE_RLIM_T macro --- acconfig.h | 5 +---- config.h.in | 5 +---- configure.in | 3 +-- lib/isc/unix/resource.c | 19 ++++++++----------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/acconfig.h b/acconfig.h index d99806a6ad..cd3877bc0f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acconfig.h,v 1.34 2001/07/04 00:34:40 bwelling Exp $ */ +/* $Id: acconfig.h,v 1.35 2001/07/14 01:55:04 gson Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -84,9 +84,6 @@ /* define if getc_unlocked() is available */ #undef HAVE_GETCUNLOCKED -/* define if rlim_t is defined via sys/types.h or sys/resource.h */ -#undef HAVE_RLIM_T - /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/config.h.in b/config.h.in index 6eac211b1b..777e7e8f56 100644 --- a/config.h.in +++ b/config.h.in @@ -16,7 +16,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.h.in,v 1.43 2001/07/04 00:34:41 bwelling Exp $ */ +/* $Id: config.h.in,v 1.44 2001/07/14 01:55:05 gson Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -95,9 +95,6 @@ /* define if getc_unlocked() is available */ #undef HAVE_GETCUNLOCKED -/* define if rlim_t is defined via sys/types.h or sys/resource.h */ -#undef HAVE_RLIM_T - /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/configure.in b/configure.in index 36cf8667f3..f0d779e995 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.277 $) +AC_REVISION($Revision: 1.278 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -1358,7 +1358,6 @@ AC_TRY_COMPILE([ #include ], [rlim_t rl = 19671212; return (0);], [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_RLIM_T) ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"], [AC_MSG_RESULT(no) diff --git a/lib/isc/unix/resource.c b/lib/isc/unix/resource.c index c8c4656f76..17742899fe 100644 --- a/lib/isc/unix/resource.c +++ b/lib/isc/unix/resource.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resource.c,v 1.10 2001/01/23 06:00:11 marka Exp $ */ +/* $Id: resource.c,v 1.11 2001/07/14 01:55:08 gson Exp $ */ #include @@ -30,10 +30,6 @@ #include "errno2result.h" -#ifndef HAVE_RLIM_T -typedef ISC_PLATFORM_RLIMITTYPE rlim_t; -#endif - static isc_result_t resource2rlim(isc_resource_t resource, int *rlim_resource) { isc_result_t result = ISC_R_SUCCESS; @@ -100,7 +96,7 @@ resource2rlim(isc_resource_t resource, int *rlim_resource) { isc_result_t isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { struct rlimit rl; - rlim_t rlim_value; + ISC_PLATFORM_RLIMITTYPE rlim_value; int unixresult; int unixresource; isc_result_t result; @@ -117,17 +113,18 @@ isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { * isc_resourcevalue_t was chosen as an unsigned 64 bit * integer so that it could contain the maximum range of * reasonable values. Unfortunately, this exceeds the typical - * range on Unix systems. Ensure the value of rlim_t is not - * overflowed. + * range on Unix systems. Ensure the range of + * ISC_PLATFORM_RLIMITTYPE is not overflowed. */ isc_resourcevalue_t rlim_max; isc_boolean_t rlim_t_is_signed = - ISC_TF(((double)(rlim_t)-1) < 0); + ISC_TF(((double)(ISC_PLATFORM_RLIMITTYPE)-1) < 0); if (rlim_t_is_signed) - rlim_max = ~((rlim_t)1 << (sizeof(rlim_t) * 8 - 1)); + rlim_max = ~((ISC_PLATFORM_RLIMITTYPE)1 << + (sizeof(ISC_PLATFORM_RLIMITTYPE) * 8 - 1)); else - rlim_max = (rlim_t)-1; + rlim_max = (ISC_PLATFORM_RLIMITTYPE)-1; if (value > rlim_max) value = rlim_max;