diff -r 2830003ed49c src/os/posix/vm/os_posix.cpp --- a/src/os/posix/vm/os_posix.cpp Mon Mar 13 20:23:11 2017 +0100 +++ b/src/os/posix/vm/os_posix.cpp Wed Mar 15 09:18:06 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, 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 @@ -1130,9 +1130,9 @@ } else { // Fallback for platforms struggling with modern Posix standards (AIX 5.3, 6.1). If realpath // returns EINVAL, this may indicate that realpath is not POSIX.1-2008 compatible and - // that it complains about the NULL we did hand down as user buffer. + // that it complains about the NULL we handed down as user buffer. // In this case, use the user provided buffer but at least check whether realpath caused - // a memory overwriter. + // a memory overwrite. if (errno == EINVAL) { outbuf[outbuflen - 1] = '\0'; p = ::realpath(filename, outbuf); diff -r 2830003ed49c src/os/posix/vm/os_posix.hpp --- a/src/os/posix/vm/os_posix.hpp Mon Mar 13 20:23:11 2017 +0100 +++ b/src/os/posix/vm/os_posix.hpp Wed Mar 15 09:18:06 2017 +0100 @@ -98,9 +98,9 @@ // A safe implementation of realpath which will not cause a buffer overflow if the resolved path // is longer than PATH_MAX. - // On success, it will return a pointer to the input buffer. - // On error, it will return NULL and set errno. Content of output buffer is undefined. - // On truncation error (output buffer too small), it will return NULL and set errno to ENAMETOOLONG. + // On success, returns 'outbuf', which now contains the path. + // On error, it will return NULL and set errno. The content of 'outbuf' is undefined. + // On truncation error ( 'outbuf' too small), it will return NULL and set errno to ENAMETOOLONG. static char* realpath(const char* filename, char* outbuf, size_t outbuflen); }; diff -r 2830003ed49c src/os/solaris/vm/os_solaris.cpp --- a/src/os/solaris/vm/os_solaris.cpp Mon Mar 13 20:23:11 2017 +0100 +++ b/src/os/solaris/vm/os_solaris.cpp Wed Mar 15 09:18:06 2017 +0100 @@ -2033,10 +2033,9 @@ Dl_info dlinfo; int ret = dladdr(CAST_FROM_FN_PTR(void *, os::jvm_path), &dlinfo); assert(ret != 0, "cannot locate libjvm"); - char* rp = NULL; if (ret != 0 && dlinfo.dli_fname != NULL) { if (os::Posix::realpath((char *)dlinfo.dli_fname, buf, buflen) == NULL) {