apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1078655 - in /apr/apr/trunk/threadproc: netware/proc.c unix/proc.c
Date Mon, 07 Mar 2011 03:03:47 GMT
Author: fuankg
Date: Mon Mar  7 03:03:46 2011
New Revision: 1078655

URL: http://svn.apache.org/viewvc?rev=1078655&view=rev
Log:
Fixed compilation when APR_HAVE_STRUCT_RLIMIT=0.

Modified:
    apr/apr/trunk/threadproc/netware/proc.c
    apr/apr/trunk/threadproc/unix/proc.c

Modified: apr/apr/trunk/threadproc/netware/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/netware/proc.c?rev=1078655&r1=1078654&r2=1078655&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/netware/proc.c (original)
+++ apr/apr/trunk/threadproc/netware/proc.c Mon Mar  7 03:03:46 2011
@@ -448,8 +448,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(
     return errno;
 }
 
-APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what,

-                          struct rlimit *limit)
+#if APR_HAVE_STRUCT_RLIMIT
+APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
+                                                 apr_int32_t what, 
+                                                 struct rlimit *limit)
 {
     switch(what) {
         case APR_LIMIT_CPU:
@@ -459,13 +461,15 @@ APR_DECLARE(apr_status_t) apr_procattr_l
 #else
             return APR_ENOTIMPL;
 #endif
+
         case APR_LIMIT_MEM:
-#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
+#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
             attr->limit_mem = limit;
             break;
 #else
             return APR_ENOTIMPL;
 #endif
+
         case APR_LIMIT_NPROC:
 #ifdef RLIMIT_NPROC
             attr->limit_nproc = limit;
@@ -473,9 +477,19 @@ APR_DECLARE(apr_status_t) apr_procattr_l
 #else
             return APR_ENOTIMPL;
 #endif
+
+        case APR_LIMIT_NOFILE:
+#ifdef RLIMIT_NOFILE
+            attr->limit_nofile = limit;
+            break;
+#else
+            return APR_ENOTIMPL;
+#endif
+
     }
     return APR_SUCCESS;
 }  
+#endif /* APR_HAVE_STRUCT_RLIMIT */
 
 APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, 
                                                 const char *username,

Modified: apr/apr/trunk/threadproc/unix/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/unix/proc.c?rev=1078655&r1=1078654&r2=1078655&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/proc.c (original)
+++ apr/apr/trunk/threadproc/unix/proc.c Mon Mar  7 03:03:46 2011
@@ -678,6 +678,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(
     return errno;
 }
 
+#if APR_HAVE_STRUCT_RLIMIT
 APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
                                                  apr_int32_t what,
                                                  struct rlimit *limit)
@@ -692,7 +693,7 @@ APR_DECLARE(apr_status_t) apr_procattr_l
 #endif
 
         case APR_LIMIT_MEM:
-#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
+#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
             attr->limit_mem = limit;
             break;
 #else
@@ -719,6 +720,7 @@ APR_DECLARE(apr_status_t) apr_procattr_l
 
     return APR_SUCCESS;
 }
+#endif /* APR_HAVE_STRUCT_RLIMIT */
 
 APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
                                                  apr_perms_setfn_t *perms_set_fn,



Mime
View raw message