1
0
mirror of https://github.com/simh/simh.git synced 2026-03-05 18:59:08 +00:00

SCP: Avoid DEPOSIT to DEVICEs which aren't attached to a seekable file

This commit is contained in:
Mark Pizzolato
2022-06-17 13:23:37 -07:00
parent 77cd8d1802
commit c13214a98c

7
scp.c
View File

@@ -8456,6 +8456,7 @@ if (uptr->fileref) { /* Only close open file */
}
uptr->fileref = NULL;
}
uptr->dynflags &= ~UNIT_NO_FIO;
return SCPE_OK;
}
@@ -10158,7 +10159,8 @@ for (i = 0, j = addr; i < sim_emax; i++, j = j + dptr->aincr) {
if (!(uptr->flags & UNIT_ATT))
return SCPE_UNATT;
if ((uptr->dynflags & UNIT_NO_FIO) ||
(uptr->fileref == NULL))
(uptr->fileref == NULL) ||
(sim_can_seek (uptr->fileref) == FALSE))
return SCPE_NOFNC;
if ((uptr->flags & UNIT_FIX) && (j >= uptr->capac)) {
reason = SCPE_NXM;
@@ -10256,7 +10258,8 @@ for (i = 0, j = addr; i < count; i++, j = j + dptr->aincr) {
else {
if (!(uptr->flags & UNIT_ATT))
return SCPE_UNATT;
if (uptr->dynflags & UNIT_NO_FIO)
if ((uptr->dynflags & UNIT_NO_FIO) ||
(sim_can_seek (uptr->fileref) == FALSE))
return SCPE_NOFNC;
if ((uptr->flags & UNIT_FIX) && (j >= uptr->capac))
return SCPE_NXM;