Do not assume RLIM_INFINITY is always (rlim_t)-1in sanitizers code

Differential Revision: http://reviews.llvm.org/D5212

llvm-svn: 217308
This commit is contained in:
Viktor Kutuzov 2014-09-06 07:52:51 +00:00
parent dcb98e5dcc
commit 1827415be4
1 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ void DisableCoreDumperIfNecessary() {
bool StackSizeIsUnlimited() {
rlim_t stack_size = getlim(RLIMIT_STACK);
return (stack_size == (rlim_t)-1);
return (stack_size == RLIM_INFINITY);
}
void SetStackSizeLimitInBytes(uptr limit) {
@ -79,11 +79,11 @@ void SetStackSizeLimitInBytes(uptr limit) {
bool AddressSpaceIsUnlimited() {
rlim_t as_size = getlim(RLIMIT_AS);
return (as_size == (rlim_t)-1);
return (as_size == RLIM_INFINITY);
}
void SetAddressSpaceUnlimited() {
setlim(RLIMIT_AS, -1);
setlim(RLIMIT_AS, RLIM_INFINITY);
CHECK(AddressSpaceIsUnlimited());
}