AltairZ80: mdfc: Fix unit detach.

This commit is contained in:
Howard M. Harte 2021-01-16 13:40:33 -08:00
parent e9d774908e
commit cc464d4acb

View file

@ -1,9 +1,7 @@
/*************************************************************************
* *
* $Id: mfdc.c 1995 2008-07-15 03:59:13Z hharte $ *
* *
* Copyright (c) 2007-2015 Howard M. Harte. *
* hharte@magicandroidapps.com *
* Copyright (c) 2007-2021 Howard M. Harte. *
* https://github.com/hharte *
* *
* Permission is hereby granted, free of charge, to any person obtaining *
* a copy of this software and associated documentation files (the *
@ -37,9 +35,6 @@
* www.hartetechnologies.com/manuals in the Vector Graphic section *
* for details of the on-disk sector format and programming information. *
* *
* Environment: *
* User mode only *
* *
*************************************************************************/
/*#define DBG_MSG */
@ -308,15 +303,12 @@ static t_stat mfdc_detach(UNIT *uptr)
return SCPE_ARG;
DBG_PRINT(("Detach MFDC%d\n", i));
r = diskClose(&mfdc_info->drive[i].imd);
if (r != SCPE_OK)
return r;
if (uptr->u3 == IMAGE_TYPE_IMD) {
diskClose(&mfdc_info->drive[i].imd);
}
r = detach_unit(uptr); /* detach unit */
if (r != SCPE_OK)
return r;
return SCPE_OK;
}