wutil: libc::unlink -> std::fs::remove_file

Part of #12380
This commit is contained in:
Daniel Rainer
2026-01-25 16:27:15 +01:00
committed by Johannes Altmanninger
parent 43513d3fca
commit 44f9363e39
3 changed files with 5 additions and 5 deletions

View File

@@ -59,9 +59,9 @@ pub fn waccess(file_name: &wstr, mode: libc::c_int) -> libc::c_int {
}
/// Wide character version of unlink().
pub fn wunlink(file_name: &wstr) -> libc::c_int {
let tmp = wcs2zstring(file_name);
unsafe { libc::unlink(tmp.as_ptr()) }
pub fn wunlink(file_name: &wstr) -> io::Result<()> {
let tmp = wcs2osstring(file_name);
fs::remove_file(tmp)
}
pub fn wperror(s: &wstr) {