1
0
mirror of https://github.com/simh/simh.git synced 2026-01-14 15:45:18 +00:00

SCP: Allow UNIT_RO flag bit to be static when UNIT_ROABLE isn't present.

This commit is contained in:
Mark Pizzolato 2018-03-25 18:09:07 -07:00
parent 9111a1a645
commit 0b209d2383

5
scp.c
View File

@ -6280,8 +6280,9 @@ if ((sim_switches & SWMASK ('R')) || /* read only? */
uptr->fileref = sim_fopen (cptr, "rb"); /* open rd only */
if (uptr->fileref == NULL) /* open fail? */
return attach_err (uptr, SCPE_OPENERR); /* yes, error */
if (!(uptr->flags & UNIT_RO))
sim_messagef (SCPE_OK, "%s: unit is read only\n", sim_dname (dptr));
uptr->flags = uptr->flags | UNIT_RO; /* set rd only */
sim_messagef (SCPE_OK, "%s: unit is read only\n", sim_dname (dptr));
}
else {
if (sim_switches & SWMASK ('N')) { /* new file only? */
@ -6451,7 +6452,7 @@ if ((uptr->flags & UNIT_BUF) && (uptr->filebuf)) {
}
uptr->flags = uptr->flags & ~UNIT_BUF;
}
uptr->flags = uptr->flags & ~(UNIT_ATT | UNIT_RO);
uptr->flags = uptr->flags & ~(UNIT_ATT | ((uptr->flags & UNIT_ROABLE) ? UNIT_RO : 0));
free (uptr->filename);
uptr->filename = NULL;
if (fclose (uptr->fileref) == EOF)