--- a/jdk/src/java.base/unix/native/libnio/ch/IOUtil.c Wed Aug 19 17:42:52 2015 +0100
+++ b/jdk/src/java.base/unix/native/libnio/ch/IOUtil.c Wed Aug 19 13:11:24 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -129,7 +129,8 @@
JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
return -1;
}
- if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
+ if (rlp.rlim_max == RLIM_INFINITY ||
+ rlp.rlim_max > (rlim_t)java_lang_Integer_MAX_VALUE) {
return java_lang_Integer_MAX_VALUE;
} else {
return (jint)rlp.rlim_max;