[PATCH 3/3] Treat IDE HD image errors similarly to ACSI/SCSI errors

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


---
 src/ide.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/ide.c b/src/ide.c
index c66ebcc5..44dc770b 100644
--- a/src/ide.c
+++ b/src/ide.c
@@ -576,14 +576,21 @@ static int bdrv_open(BlockDriverState *bs, const char *filename, unsigned long b
 		/* Maybe the file is read-only? */
 		bs->fhndl = fopen(filename, "rb");
 		if (!bs->fhndl)
+		{
 			perror("bdrv_open");
+			Log_AlertDlg(LOG_WARN, "IDE HD file open failed\n'%s'.\n", filename);
+			return -1;
+		}
+		Log_AlertDlg(LOG_WARN, "IDE HD file is read-only, no writes will go through\n'%s'.\n",
+			     filename);
 		bs->read_only = 1;
 	}
 	else if (!File_Lock(bs->fhndl))
 	{
-		Log_Printf(LOG_ERROR, "Cannot lock IDE HD file for writing!\n");
+		Log_AlertDlg(LOG_ERROR, "Locking ID HD file for writing failed\n'%s'!\n", filename);
 		fclose(bs->fhndl);
 		bs->fhndl = NULL;
+		return -1;
 	}
 
 	/* call the change callback */
-- 
2.20.1


--------------5B665AC7BF12A75683BFBB6E
Content-Type: text/x-patch; charset=UTF-8;
 name="0002-Disable-failing-HD-images.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-Disable-failing-HD-images.patch"



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/