You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/12/15 15:15:28 UTC

[trafficserver] branch 7.1.x updated: use warning instead of assert for setrlimit()

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new b49a5ef  use warning instead of assert for setrlimit()
b49a5ef is described below

commit b49a5ef75d282f9f2f1884f100e64fe640bb8bb2
Author: Fei Deng <du...@gmail.com>
AuthorDate: Wed Dec 13 16:24:37 2017 -0600

    use warning instead of assert for setrlimit()
    
    (cherry picked from commit 4716d68a4085f68f289763f622b26759762dcfcb)
---
 lib/ts/ink_sys_control.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/ts/ink_sys_control.cc b/lib/ts/ink_sys_control.cc
index e1d3e71..ee79bb7 100644
--- a/lib/ts/ink_sys_control.cc
+++ b/lib/ts/ink_sys_control.cc
@@ -24,6 +24,7 @@
 #include "ts/ink_defs.h"
 #include "ts/ink_assert.h"
 #include "ts/ink_sys_control.h"
+#include "ts/Diags.h"
 
 rlim_t
 ink_max_out_rlimit(int which, bool max_it, bool unlim_it)
@@ -47,7 +48,9 @@ ink_max_out_rlimit(int which, bool max_it, bool unlim_it)
 #else
       rl.rlim_cur = rl.rlim_max;
 #endif
-      ink_release_assert(setrlimit(MAGIC_CAST(which), &rl) >= 0);
+      if (setrlimit(MAGIC_CAST(which), &rl) != 0) {
+        Warning("Failed to set Limit : %s", strerror(errno));
+      }
     }
   }
 
@@ -56,7 +59,9 @@ ink_max_out_rlimit(int which, bool max_it, bool unlim_it)
     ink_release_assert(getrlimit(MAGIC_CAST(which), &rl) >= 0);
     if (rl.rlim_cur != (rlim_t)RLIM_INFINITY) {
       rl.rlim_cur = (rl.rlim_max = RLIM_INFINITY);
-      ink_release_assert(setrlimit(MAGIC_CAST(which), &rl) >= 0);
+      if (setrlimit(MAGIC_CAST(which), &rl) != 0) {
+        Warning("Failed to set Limit : %s", strerror(errno));
+      }
     }
   }
 #endif

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].