diff options
author | joerg <joerg@FreeBSD.org> | 1996-02-22 00:33:35 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-02-22 00:33:35 +0000 |
commit | c5181fe0d9df7a34fa3c95255ea660d64846d8ec (patch) | |
tree | dafc2c22e9698820981250a0e036bd2c4bc121af /usr.bin/mt/mt.c | |
parent | 0e9d63c38baf0f9246c39e2e9030048b3f7635f8 (diff) | |
download | FreeBSD-src-c5181fe0d9df7a34fa3c95255ea660d64846d8ec.zip FreeBSD-src-c5181fe0d9df7a34fa3c95255ea660d64846d8ec.tar.gz |
. cast the error and status registers properly to (unsigned short),
to avoid misinterpreting the 0x8000 bit as a negative sign,
. use the <machine/wtio.h> register def's to print them.
Diffstat (limited to 'usr.bin/mt/mt.c')
-rw-r--r-- | usr.bin/mt/mt.c | 14 |
1 files changed, 9 insertions, 5 deletions
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 <tahoe/vba/cyreg.h> #endif +#ifdef __FreeBSD__ +#include <machine/wtio.h> +#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__) } |