> On both ReFS and removable drives, the primary path in libGetXSpace.c,
> (which calls `GetDiskSpaceInformationW()` API function) fails because
> the API call fails.  When that happens, the code throws an exception,
> causing the test to fail.
> 
> The key change in this patch is to switch to the fallback path (of
> calling `GetDiskFreeSpaceExW()` to estimate the disk space) when
> `GetDiskSpaceInformationW()` fails, making the test pass on machines
> that have such non-standard volumes.  This has the ancillary benefit of
> handling _all_ kinds of removable drives, so this patch removes the
> special case for handling CDROM drives (whose code shelled out to "df",
> which doesn't exist outside of Cygwin and MSys/MinGW).
> 
> This patch also fixes the return types and their handling for both
> `GetDiskSpaceInformationW()` and `GetDiskFreeSpaceExW()` to match the
> Windows API documentation.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Ashay Rane has updated the pull request incrementally with one additional 
commit since the last revision:

  Fix comment

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/31682/files
  - new: https://git.openjdk.org/jdk/pull/31682/files/67088905..38f0ff86

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=31682&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=31682&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/31682.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31682/head:pull/31682

PR: https://git.openjdk.org/jdk/pull/31682

Reply via email to