From 6a00d0d937aabd0354e4b30381183a129bdabe10 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 18 Jul 2011 09:49:34 -0400 Subject: [PATCH] Add mt option to return 2-word zero record instead of error status, to test how magrst behaves. It treats this just like a real tape error, which is good. If mtwrite is used to re-create a physical tape from a .tap file, it cannot re-create tape errors, so writes a 4-byte zero record instead. Prime magrst will still see this as an error record since it isn't long enough to be a real magsav record. --- emdev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emdev.h b/emdev.h index 6e7c6c7..91880e7 100644 --- a/emdev.h +++ b/emdev.h @@ -755,8 +755,13 @@ fmterr: if (reclen & 0x80000000) { /* record marked in error */ /* XXX: can .tap have non-zero record length here? */ fprintf(stderr,"tape read error at position %lld\n", lseek(fd, 0, SEEK_CUR)); +#if 1 *mtstat |= 0xB600; /* set all error bits */; return 0; +#else + *(int *)iobuf = 0; /* return a 2-word zero record on errors */ + return 2; +#endif } if (reclen & 1) warn("odd-length record in tape file!");