8202353: os::readdir should use readdir instead of readdir_r

8202835: jfr/event/os/TestSystemProcess.java fails on missing events

Os::readdir uses POSIX readdir, drop buffer arg, fix JFR uses.

Reviewed-by: coleenp, tschatzl, bsrbnd
This commit is contained in:
Kim Barrett 2018-07-17 15:59:47 -04:00
parent f4723253b6
commit 9a9c824ece
22 changed files with 54 additions and 238 deletions

View file

@ -3506,8 +3506,7 @@ bool os::dir_is_empty(const char* path) {
// Scan the directory
bool result = true;
char buf[sizeof(struct dirent) + MAX_PATH];
while (result && (ptr = ::readdir(dir)) != NULL) {
while (result && (ptr = readdir(dir)) != NULL) {
if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
result = false;
}