diff --git a/make/linux/Makefile b/make/linux/Makefile index fa1f56dd85578b7fef4895ab5a012c5a2c97216a..d79d4fbfd02b394bb7a7f8d5f059c3f1c01bd68e 100644 --- a/make/linux/Makefile +++ b/make/linux/Makefile @@ -230,7 +230,7 @@ checks: check_os_version check_j2se_version # Solaris 2.5.1, 2.6). # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok. -SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7% +SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% OS_VERSION := $(shell uname -r) EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION)) diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp index 5da11080718fe8d792c0c14bfd1c9a3820ca1380..28c65595108424c3ae1152cfe7e0e59e47923d11 100644 --- a/src/share/vm/runtime/os.cpp +++ b/src/share/vm/runtime/os.cpp @@ -1299,7 +1299,7 @@ int os::get_line_chars(int fd, char* buf, const size_t bsize){ size_t sz, i = 0; // read until EOF, EOL or buf is full - while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-1) && buf[i] != '\n') { + while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-2) && buf[i] != '\n') { ++i; } @@ -1320,7 +1320,7 @@ int os::get_line_chars(int fd, char* buf, const size_t bsize){ } // line is longer than size of buf, skip to EOL - int ch; + char ch; while (read(fd, &ch, 1) == 1 && ch != '\n') { // Do nothing }