You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2017/12/15 14:46:18 UTC
[trafficserver] branch master updated: use warning instead of
assert for setrlimit()
This is an automated email from the ASF dual-hosted git repository.
shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 4716d68 use warning instead of assert for setrlimit()
4716d68 is described below
commit 4716d68a4085f68f289763f622b26759762dcfcb
Author: Fei Deng <du...@gmail.com>
AuthorDate: Wed Dec 13 16:24:37 2017 -0600
use warning instead of assert for setrlimit()
---
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 31677a9..968bab6 100644
--- a/lib/ts/ink_sys_control.cc
+++ b/lib/ts/ink_sys_control.cc
@@ -26,6 +26,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)
@@ -49,7 +50,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));
+ }
}
}
@@ -58,7 +61,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>'].