1
0
mirror of https://github.com/simh/simh.git synced 2026-01-26 12:02:14 +00:00

Added a device flag which can be used to avoid auto detach at device attach time.

This commit is contained in:
Mark Pizzolato
2013-06-17 21:17:49 -07:00
parent e13b1fed55
commit 97eb58cfc4
2 changed files with 11 additions and 6 deletions

15
scp.c
View File

@@ -3656,12 +3656,15 @@ if (dptr == NULL) /* found dev? */
return SCPE_NXDEV;
if (uptr == NULL) /* valid unit? */
return SCPE_NXUN;
if ((uptr->flags & UNIT_ATT) && /* already attached? */
!(uptr->dynflags & UNIT_ATTMULT)) { /* and only single attachable */
r = scp_detach_unit (dptr, uptr); /* detach it */
if (r != SCPE_OK) /* error? */
return r;
}
if (uptr->flags & UNIT_ATT) /* already attached? */
if (!(uptr->dynflags & UNIT_ATTMULT) && /* and only single attachable */
!(dptr->flags & DEV_DONTAUTO)) { /* and auto detachable */
r = scp_detach_unit (dptr, uptr); /* detach it */
if (r != SCPE_OK) /* error? */
return r;
}
else
return SCPE_ALATT; /* Already attached */
sim_trim_endspc (cptr); /* trim trailing spc */
return scp_attach_unit (dptr, uptr, cptr); /* attach */
}