Get BUFSIZ from libc

This commit is contained in:
Andrew Phillips
2023-09-06 13:35:55 +00:00
parent 469d74888d
commit 388d2a8666

View File

@@ -41,8 +41,6 @@ use is_terminal::IsTerminal;
extern crate term; extern crate term;
const BUFSIZ: usize = 8192;
lazy_static! { lazy_static! {
static ref FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR: TableFormat = format::FormatBuilder::new() static ref FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR: TableFormat = format::FormatBuilder::new()
.column_separator('│') .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 stdin = io::stdin().lock();
let mut stdout = io::stdout().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 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()) 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"); debug!("MAIN: Starting IO loop");
loop { loop {
let n = stdin.read(&mut buffer[..BUFSIZ])?; let n = stdin.read(&mut buffer[..libc::BUFSIZ as usize])?;
if n == 0 { if n == 0 {
debug!("MAIN: EOF on STDIN"); debug!("MAIN: EOF on STDIN");