[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] mintara.prg hangs on non-ARAnyM



Hello.

I have noticed that mintara.prg hangs on non-ARAnyM (ex: Hatari with 68040). While mintara.prg should only be used on ARAnyM, it should not hang or crash on other systems.

It hangs just after displaying:
Installing BIOS keyboard table ... AKP 0, ISO 0.

Actually, it crashes because the hostfs initialization failed, but hostfs_fs_root() is called nevertheless. While the nf_call pointer is still null.

The following patch fixes this problem. Please commit.

hostfs.patch
Fixed mintara.prg startup hang on non-ARAnyM systems. Contributed by Vincent Riviere.

--
Vincent Rivière
--- freemint.orig/sys/filesys.c	2010-01-13 18:13:49.000000000 +0100
+++ freemint/sys/filesys.c	2013-01-01 16:33:38.921875000 +0100
@@ -64,6 +64,9 @@
 
 
 static void
+xfs_dismiss (FILESYS *fs);
+
+static void
 xfs_blocking_init (FILESYS *fs)
 {
 # ifdef NONBLOCKING_DMA
@@ -265,8 +268,12 @@
 		FILESYS *fs = hostfs_init ();
 		if ( fs )
 			hostfs_mount_drives( fs );
+		else
+			xfs_dismiss( &hostfs_filesys );
 	}
 # endif
+
+	UNUSED (xfs_dismiss); /* Maybe */
 }
 
 # ifdef DEBUG_INFO
@@ -359,6 +366,24 @@
 	}
 }
 
+/* dismiss a file system which failed to initialize */
+static void
+xfs_dismiss (FILESYS *fs)
+{
+	FILESYS **p;
+
+	for (p = &active_fs; *p; p = &(*p)->next)
+	{
+		if (*p == fs)
+		{
+			*p = (*p)->next;
+			fs->next = NULL;
+
+			return;
+		}
+	}
+}
+
 void
 close_filesys (void)
 {