1
0
mirror of https://github.com/simh/simh.git synced 2026-04-18 00:48:13 +00:00

SCP: Fix dangling perror details

This commit is contained in:
Mark Pizzolato
2015-04-03 20:11:21 -07:00
parent 41978eca80
commit 1548777278
5 changed files with 14 additions and 8 deletions

View File

@@ -1349,13 +1349,16 @@ return SCPE_OK;
t_stat sim_disk_perror (UNIT *uptr, const char *msg)
{
int saved_errno = errno;
if (!(uptr->flags & UNIT_ATTABLE)) /* not attachable? */
return SCPE_NOATT;
switch (DK_GET_FMT (uptr)) { /* case on format */
case DKUF_F_STD: /* SIMH format */
case DKUF_F_VHD: /* VHD format */
case DKUF_F_RAW: /* Raw Physical Disk Access */
sim_printf ("%s %s: %s\n", sim_uname(uptr), msg, strerror(errno));
perror (msg);
sim_printf ("%s %s: %s\n", sim_uname(uptr), msg, strerror(saved_errno));
default:
;
}