diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs index b28a5f274..16ef31f96 100644 --- a/pbs-tape/src/sg_tape.rs +++ b/pbs-tape/src/sg_tape.rs @@ -571,9 +571,10 @@ impl SgTape { } } - pub fn wait_until_ready(&mut self) -> Result<(), Error> { + pub fn wait_until_ready(&mut self, timeout: Option) -> Result<(), Error> { let start = SystemTime::now(); - let max_wait = std::time::Duration::new(Self::SCSI_TAPE_DEFAULT_TIMEOUT as u64, 0); + let timeout = timeout.unwrap_or(Self::SCSI_TAPE_DEFAULT_TIMEOUT as u64); + let max_wait = std::time::Duration::new(timeout, 0); loop { match self.test_unit_ready() { diff --git a/src/tape/drive/lto/mod.rs b/src/tape/drive/lto/mod.rs index 2c3a5a635..97dd540fb 100644 --- a/src/tape/drive/lto/mod.rs +++ b/src/tape/drive/lto/mod.rs @@ -55,7 +55,7 @@ pub fn open_lto_tape_drive(config: &LtoTapeDrive) -> Result