httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: [PATCH] setrlimit fix, #2
Date Thu, 24 Aug 2000 19:28:12 GMT

I would really like to understand why this is happening.  If you grep
src/main for "#if .", we do this sort of thing all the time.

Ryan

On Thu, 24 Aug 2000, Victor J. Orlikowski wrote:

> Ok, so we don't want to check for definition, we want to check for
> equality to 1.
> 
> Index: src/lib/apr/threadproc/unix/proc.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/threadproc/unix/proc.c,v
> retrieving revision 1.37
> diff -u -r1.37 proc.c
> --- proc.c	2000/08/23 23:28:49	1.37
> +++ proc.c	2000/08/24 19:15:33
> @@ -227,7 +227,7 @@
>  
>  static apr_status_t limit_proc(apr_procattr_t *attr)
>  {
> -#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT
> +#if APR_HAVE_STRUCT_RLIMIT == 1 && APR_HAVE_SETRLIMIT == 1
>  #ifdef RLIMIT_CPU
>      if (attr->limit_cpu != NULL) {
>          if ((setrlimit(RLIMIT_CPU, attr->limit_cpu)) != 0) {
> Index: src/os/unix/unixd.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/os/unix/unixd.c,v
> retrieving revision 1.24
> diff -u -r1.24 unixd.c
> --- unixd.c	2000/08/23 23:28:54	1.24
> +++ unixd.c	2000/08/24 19:15:35
> @@ -342,7 +342,7 @@
>  API_EXPORT(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, 
>                             const char *arg, const char * arg2, int type)
>  {
> -#if (defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC)
|| defined(RLIMIT_AS)) && APR_HAVE_STRUCT_RLIMIT && APR_HAVE_GETRLIMIT
> +#if (defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC)
|| defined(RLIMIT_AS)) && APR_HAVE_STRUCT_RLIMIT == 1 && APR_HAVE_GETRLIMIT
== 1
>      char *str;
>      struct rlimit *limit;
>      /* If your platform doesn't define rlim_t then typedef it in ap_config.h */
> 
> -- 
> Victor J. Orlikowski
> ======================
> v.j.orlikowski@gte.net
> vjo@raleigh.ibm.com
> vjo@us.ibm.com
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message