tape: fix non-rewinding tape device check

This commit is contained in:
Dietmar Maurer 2020-12-25 15:38:29 +01:00
parent 8ae9f4efc2
commit fc6ce9835b

View File

@ -57,6 +57,7 @@ impl LinuxTapeDrive {
///
/// This does additional checks:
///
/// - check if it is a non-rewinding tape device
/// - check if drive is ready (tape loaded)
/// - check block size
pub fn open(&self) -> Result<LinuxTapeHandle, Error> {
@ -387,7 +388,7 @@ pub fn check_tape_is_linux_tape_device(file: &File) -> Result<(), Error> {
let major = unsafe { libc::major(devnum) };
let minor = unsafe { libc::minor(devnum) };
if !(major != 9) {
if major != 9 {
bail!("not a tape device");
}
if (minor & 128) == 0 {