From 251905da3dccbd51d9a2d2a1becc8e99eda97b30 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Tue, 26 May 2020 12:32:57 -0500 Subject: [PATCH] fix/du ~ update to correct WinAPI usage (fixes #1496) --- src/uu/df/Cargo.toml | 3 +-- src/uu/df/src/df.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/uu/df/Cargo.toml b/src/uu/df/Cargo.toml index ac4617bf8..e73a8a8b7 100644 --- a/src/uu/df/Cargo.toml +++ b/src/uu/df/Cargo.toml @@ -22,8 +22,7 @@ uucore = { version="0.0.3", package="uucore", git="https://github.com/uutils/uuc uucore_procs = { version="0.0.3", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } [target.'cfg(target_os = "windows")'.dependencies] -kernel32-sys = "0.2" -winapi = { version = "0.3", features = ["handleapi", "winerror"] } +winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] } [[bin]] name = "df" diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index 37475a3e5..cac445a07 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -13,16 +13,16 @@ extern crate number_prefix; #[macro_use] extern crate uucore; -#[cfg(windows)] -extern crate kernel32; +use clap::{App, Arg}; + #[cfg(windows)] extern crate winapi; - -use clap::{App, Arg}; #[cfg(windows)] -use kernel32::{ - FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetLastError, - GetVolumeInformationW, GetVolumePathNamesForVolumeNameW, QueryDosDeviceW, +use winapi::um::errhandlingapi::GetLastError; +#[cfg(windows)] +use winapi::um::fileapi::{ + FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetVolumeInformationW, + GetVolumePathNamesForVolumeNameW, QueryDosDeviceW, }; use number_prefix::{binary_prefix, decimal_prefix, PrefixNames, Prefixed, Standalone};