diff --git a/bzip2.rs b/bzip2.rs index 06ec7d8b1..ca039ea4c 100644 --- a/bzip2.rs +++ b/bzip2.rs @@ -4,6 +4,7 @@ use std::ffi::{c_char, CStr, CString, OsStr}; use std::io::IsTerminal; +use std::io::Write; use std::mem::zeroed; use std::path::{Path, PathBuf}; use std::ptr; @@ -21,7 +22,6 @@ use libc::{ extern "C" { static mut stdin: *mut FILE; static mut stdout: *mut FILE; - static mut stderr: *mut FILE; } type Bool = libc::c_uchar; @@ -1298,7 +1298,7 @@ unsafe fn compress(name: *mut c_char) { if verbosity >= 1 as libc::c_int { eprint!(" {}: ", CStr::from_ptr(inName.as_ptr()).to_string_lossy(),); pad(inName.as_mut_ptr()); - fflush(stderr); + let _ = std::io::stderr().flush(); } outputHandleJustInCase = outStr; delete_output_on_interrupt = true; @@ -1553,7 +1553,7 @@ unsafe fn uncompress(name: Option) { if verbosity >= 1 { eprint!(" {}: ", in_name.display(),); pad(inName.as_mut_ptr()); - fflush(stderr); + let _ = std::io::stderr().flush(); } /*--- Now the input and output handles are sane. Do the Biz. ---*/ @@ -1706,7 +1706,7 @@ unsafe fn testf(name: Option) { if verbosity >= 1 { eprint!(" {}: ", in_name.display()); pad(inName.as_mut_ptr()); - fflush(stderr); + let _ = std::io::stderr().flush(); } outputHandleJustInCase = std::ptr::null_mut::(); let allOK = testStream(inStr);