[uae] [PATCH] Fix for loss of FSDB changes (was Re: Re: Snapshot 20070227)

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Sun, 25 Feb 2007 14:37:27 -0500

On Sunday 25 February 2007 14:10, Richard Drummond wrote:
> It does create _UAEFSDB.___ files here. However, I've just noticed that
> there's a problem if you stop or quit the emulator and it hasn't yet
> created or written out changes to a _UAEFSDB.___ file - those changes get
> lost. (This doesn't happen if you reset the emulator, BTW.) I'll have a
> look at that...

The attached patch (against 0.8.29-20070223) should fix the problem.

(I just noticed that the subject of this thread said it was 20070227. Ooops.)

When the emulator was stopped, cached changes left unwritten were being lost. 
The patch ensures that they do get flushed before the emulator shuts down. 
This bug was introduced with the changes I made to emulator state management 
since WIP3 - that was why WIP3 worked okay.

Francis, thanks for the report.

Cheers,
Rich
Index: src/main.c
===================================================================
RCS file: /cvsroot/uaedev/uae/src/main.c,v
retrieving revision 1.51
diff -u -r1.51 main.c
--- src/main.c  23 Feb 2007 02:07:58 -0000      1.51
+++ src/main.c  25 Feb 2007 19:26:10 -0000
@@ -912,9 +912,11 @@
 
            set_inhibit_frame (IHF_QUIT_PROGRAM);
 
-           if (uae_target_state == UAE_STATE_COLD_START || uae_target_state == 
UAE_STATE_WARM_START) {
-               filesys_prepare_reset ();
-           }
+#ifdef FILESYS
+           /* Ensure any cached changes to virtual filesystem are flushed 
before
+            * resetting or exitting. */
+           filesys_prepare_reset ();
+#endif
 
        } /* while (!QUITTING && !STOPPED) */
 

Other related posts: