From 9ca26e5b477bad085637a6d25b69ad5ccacb1d9e Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 11 Jun 2022 21:30:56 -0700 Subject: [PATCH] DISK: Read Only open while gathering details for DISKINFO command --- sim_disk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sim_disk.c b/sim_disk.c index d19cf034..3024f083 100644 --- a/sim_disk.c +++ b/sim_disk.c @@ -2935,7 +2935,7 @@ if ((DK_GET_FMT (uptr) == DKUF_F_VHD) || (ctx->footer)) { container_dtype = (char *)ctx->footer->DriveType; } if (dtype) { - char cmd[32]; + char cmd[64]; t_stat r = SCPE_OK; if ((strcmp (container_dtype, dtype) == 0) || @@ -6653,7 +6653,7 @@ if (info->flag == 0) { container = sim_vhd_disk_open (FullPath, "r"); if (container == NULL) { sim_disk_set_fmt (uptr, 0, "SIMH", NULL); - container = sim_fopen (FullPath, "rb+"); + container = sim_fopen (FullPath, "rb"); close_function = fclose; size_function = sim_fsize_ex; } @@ -6665,7 +6665,7 @@ if (info->flag == 0) { container_size = size_function (container); uptr->filename = strdup (FullPath); uptr->fileref = container; - uptr->flags |= UNIT_ATT; + uptr->flags |= UNIT_ATT | UNIT_RO; get_disk_footer (uptr); f = ctx->footer; if (f) {