Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows #20683

Closed
wants to merge 27 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e59cad6
hoist os::Posix::realpath() to os::realpath()
stooke Aug 22, 2024
44609e8
get rid of os::posix::realpath() and os::win32::realpath()
stooke Sep 4, 2024
b7f495b
simplify windwos realpath() implementation
stooke Sep 4, 2024
a8abb0e
move os::realpath() to previous location
stooke Sep 11, 2024
f9202c0
move os::realpath() to previous location
stooke Sep 11, 2024
9d9418d
properly test for buffer too small for path
stooke Sep 11, 2024
4da45cb
fix missing return statement
stooke Sep 12, 2024
1eeac69
fix indentation
stooke Sep 12, 2024
33c4b40
remove empty line
stooke Sep 12, 2024
20f697a
added gtest for realpath
stooke Sep 17, 2024
7daad7c
use MAX_PATH only
stooke Sep 17, 2024
7757e90
Define MAX_PATH if required
stooke Sep 17, 2024
ee870f7
fix realpath() test for POSIX
stooke Sep 18, 2024
eb1fd99
Merge branch 'master' into pr_windows_realpath
stooke Sep 18, 2024
15db6b7
remove conditional compilation
stooke Sep 18, 2024
24bfde2
remove tabs
stooke Sep 18, 2024
a7a76e9
fix realpath test on macOS
stooke Sep 20, 2024
920f67d
delete commented out code
stooke Sep 20, 2024
6715569
feedback from review
stooke Oct 9, 2024
e1b2c53
account for Windows behviour changes
stooke Oct 9, 2024
e8c29ff
remove accidently commited file
stooke Oct 9, 2024
9fe1466
Merge branch 'master' into pr_windows_realpath
stooke Oct 9, 2024
673269c
odd github behaviour
stooke Oct 12, 2024
b189303
spelling mistake
stooke Oct 13, 2024
b7e6043
clean up test code
stooke Oct 13, 2024
fbafbf0
clean up comments per PR review
stooke Oct 16, 2024
1467917
clean up whitespace error
stooke Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/hotspot/share/services/diagnosticCommand.cpp
Original file line number Diff line number Diff line change
@@ -1202,12 +1202,10 @@ void SystemDumpMapDCmd::execute(DCmdSource source, TRAPS) {
output()->print_cr("(NMT is disabled, will not annotate mappings).");
}
MemMapPrinter::print_all_mappings(&fs);
#ifndef _WIN64
// For the readers convenience, resolve path name.
char tmp[JVM_MAXPATHLEN];
const char* absname = os::realpath(name, tmp, sizeof(tmp));
name = absname != nullptr ? absname : name;
#endif
output()->print_cr("Memory map dumped to \"%s\".", name);
} else {
output()->print_cr("Failed to open \"%s\" for writing (%s).", name, os::strerror(errno));

Unchanged files with check annotations Beta

static const char* nosuchpath = "/1234567890123456789";
static const char* tmppath = "/tmp";
char buffer[MAX_PATH];

Check failure on line 417 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 0: tab
errno = 0;
const char* returnedBuffer = os::realpath(nosuchpath, buffer, sizeof(nosuchpath) - 2);

Check failure on line 420 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 0: tab
/* Returns ENOENT on Linux, ENAMETOOLONG on Windows */
EXPECT_TRUE(returnedBuffer == nullptr);
EXPECT_TRUE(errno == ENAMETOOLONG || errno == ENOENT);
errno = 0;
returnedBuffer = os::realpath(nosuchpath, buffer, sizeof(nosuchpath) + 3);

Check failure on line 426 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 0: tab
/* Returns ENOENT on Linux, 0 on Windows */
EXPECT_TRUE(errno == 0 || errno == ENOENT);
EXPECT_TRUE(returnedBuffer == nullptr || returnedBuffer == buffer);
errno = 0;

Check failure on line 431 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 0: tab
returnedBuffer = os::realpath(tmppath, buffer, MAX_PATH);

Check failure on line 432 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 0: tab
EXPECT_TRUE(returnedBuffer == buffer);
errno = 0;
returnedBuffer = os::realpath(tmppath, buffer, strlen(tmppath) + 3);

Check failure on line 436 in test/hotspot/gtest/runtime/test_os.cpp

openjdk / jcheck-openjdk/jdk-20683

Whitespace error

Column 70: trailing whitespace
EXPECT_TRUE(returnedBuffer == buffer);
errno = 0;