RFR: JDK-8286869: unify os::dir_is_empty across posix platforms

David Holmes dholmes at openjdk.java.net
Wed May 18 06:53:45 UTC 2022


On Tue, 17 May 2022 13:33:57 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> The os::dir_is_empty coding is very similar across Posix platforms and could be unified to os_posix.cpp .

Looks fine - one suggested tweak below.

Won't it be nice if one day we can use `std::filesystem::is_empty` :)

src/hotspot/os/posix/os_posix.cpp line 260:

> 258:   // Scan the directory
> 259:   bool result = true;
> 260:   while (result && (ptr = readdir(dir)) != NULL) {

This will call `os::readdir` when we can just call `::readdir` directly.

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8750


More information about the hotspot-runtime-dev mailing list