mt: Complain about write protection if write protected

Print the message if status bit is one, not zero.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
This commit is contained in:
Kai Mäkisara
2024-11-28 19:54:54 +02:00
committed by Iustin Pop
parent 72f9eda87d
commit 9c8f170d4a

2
mt.c
View File

@@ -776,6 +776,6 @@ static void test_error(int mtfd, cmdef_tr *cmd)
if ((cmd->error_tests & ET_ONLINE) && !GMT_ONLINE(status.mt_gstat))
fprintf(stderr,
"mt: The device is offline (not powered on, no tape ?).\n");
if ((cmd->error_tests & ET_WPROT) && !GMT_WR_PROT(status.mt_gstat))
if ((cmd->error_tests & ET_WPROT) && GMT_WR_PROT(status.mt_gstat))
fprintf(stderr, "mt: The tape is write-protected.\n");
}