Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203680

os::stat() on Posix platform does not need to copy input path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • None
    • b19

        1) os::stat() on all Posix platforms copies the input path into a fixed sized temp buffer, thereby risking truncation, only to call os::native_path() which is a noop on all Posix platforms.

        Just call ::stat() directly, no need for the buffer.

        Also, the coding can be unified in os_posix.cpp.

        2) os::native_path() exists for the sole purpose of making windows happy, this should be a windows only function (os::win32) and be removed from os.hpp. A comment would be helpful.

              stuefe Thomas Stuefe
              stuefe Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: