Get BUFSIZ from libc
This commit is contained in:
@@ -41,8 +41,6 @@ use is_terminal::IsTerminal;
|
||||
|
||||
extern crate term;
|
||||
|
||||
const BUFSIZ: usize = 8192;
|
||||
|
||||
lazy_static! {
|
||||
static ref FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR: TableFormat = format::FormatBuilder::new()
|
||||
.column_separator('│')
|
||||
@@ -364,7 +362,7 @@ fn mode_save(cmd: &mut Command, args: Args, ids: &mut Vec<i64>, tags: &mut Vec<S
|
||||
|
||||
let mut stdin = io::stdin().lock();
|
||||
let mut stdout = io::stdout().lock();
|
||||
let mut buffer = [0; BUFSIZ];
|
||||
let mut buffer = [0; libc::BUFSIZ as usize];
|
||||
|
||||
let compression_engine = compression::get_engine(compression_type.clone()).expect("Unable to get compression engine");
|
||||
let mut item_out: Box<dyn Write> = compression_engine.create(item_path.clone())
|
||||
@@ -372,7 +370,7 @@ fn mode_save(cmd: &mut Command, args: Args, ids: &mut Vec<i64>, tags: &mut Vec<S
|
||||
|
||||
debug!("MAIN: Starting IO loop");
|
||||
loop {
|
||||
let n = stdin.read(&mut buffer[..BUFSIZ])?;
|
||||
let n = stdin.read(&mut buffer[..libc::BUFSIZ as usize])?;
|
||||
|
||||
if n == 0 {
|
||||
debug!("MAIN: EOF on STDIN");
|
||||
|
||||
Reference in New Issue
Block a user