From c5181fe0d9df7a34fa3c95255ea660d64846d8ec Mon Sep 17 00:00:00 2001 From: joerg Date: Thu, 22 Feb 1996 00:33:35 +0000 Subject: . cast the error and status registers properly to (unsigned short), to avoid misinterpreting the 0x8000 bit as a negative sign, . use the register def's to print them. --- usr.bin/mt/mt.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c index a788b30..0eb9a1f 100644 --- a/usr.bin/mt/mt.c +++ b/usr.bin/mt/mt.c @@ -219,6 +219,10 @@ main(argc, argv) #include #endif +#ifdef __FreeBSD__ +#include +#endif + struct tape_desc { short t_type; /* type of magtape device */ char *t_name; /* printing name */ @@ -241,7 +245,7 @@ struct tape_desc { #endif #if defined (__FreeBSD__) /* - * XXX This is terrific. The st driver reports the tape drive + * XXX This is weird. The st driver reports the tape drive * as 0x7 (MT_ISAR - Sun/Archive compatible); the wt driver * either reports MT_ISVIPER1 for an Archive tape, or 0x11 * (MT_ISMFOUR) for other tapes. @@ -249,8 +253,8 @@ struct tape_desc { * magtape driver. */ { MT_ISAR, "SCSI tape drive", 0, 0 }, - { MT_ISVIPER1, "Archive Viper", 0, 0 }, - { MT_ISMFOUR, "Wangtek", 0, 0 }, + { MT_ISVIPER1, "Archive Viper", WTDS_BITS, WTER_BITS }, + { MT_ISMFOUR, "Wangtek", WTDS_BITS, WTER_BITS }, #endif /* defined (__FreeBSD__) */ { 0 } }; @@ -279,8 +283,8 @@ status(bp) else { #endif /* defined (__FreeBSD__) */ (void)printf("%s tape drive, residual=%d\n", mt->t_name, bp->mt_resid); - printreg("ds", bp->mt_dsreg, mt->t_dsbits); - printreg("\ner", bp->mt_erreg, mt->t_erbits); + printreg("ds", (unsigned short)bp->mt_dsreg, mt->t_dsbits); + printreg("\ner", (unsigned short)bp->mt_erreg, mt->t_erbits); (void)putchar('\n'); #if defined (__FreeBSD__) } -- cgit v1.1