fix/du ~ update to correct WinAPI usage (fixes #1496)

This commit is contained in:
Roy Ivy III 2020-05-26 12:32:57 -05:00
parent 403a6a3935
commit 251905da3d
2 changed files with 8 additions and 9 deletions

View file

@ -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" } uucore_procs = { version="0.0.3", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" }
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
kernel32-sys = "0.2" winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] }
winapi = { version = "0.3", features = ["handleapi", "winerror"] }
[[bin]] [[bin]]
name = "df" name = "df"

View file

@ -13,16 +13,16 @@ extern crate number_prefix;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
#[cfg(windows)] use clap::{App, Arg};
extern crate kernel32;
#[cfg(windows)] #[cfg(windows)]
extern crate winapi; extern crate winapi;
use clap::{App, Arg};
#[cfg(windows)] #[cfg(windows)]
use kernel32::{ use winapi::um::errhandlingapi::GetLastError;
FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetLastError, #[cfg(windows)]
GetVolumeInformationW, GetVolumePathNamesForVolumeNameW, QueryDosDeviceW, use winapi::um::fileapi::{
FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetVolumeInformationW,
GetVolumePathNamesForVolumeNameW, QueryDosDeviceW,
}; };
use number_prefix::{binary_prefix, decimal_prefix, PrefixNames, Prefixed, Standalone}; use number_prefix::{binary_prefix, decimal_prefix, PrefixNames, Prefixed, Standalone};