]> git.sur5r.net Git - cc65/commitdiff
Changed priorities of destructors so atexit will be called before open files
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 28 Jan 2011 10:55:03 +0000 (10:55 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 28 Jan 2011 10:55:03 +0000 (10:55 +0000)
are closed on exit, so atexit handlers may close the files themselves or
whatever is necessary for a clean shutdown.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4939 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/open.s
libsrc/atari/open.s
libsrc/cbm/open.s
libsrc/common/atexit.s

index 2e867a66fbe244cc183445c90664c4e69cf3209b..e7f603aa5ae872457522a81a6aeee2a6af84c9f6 100644 (file)
@@ -9,7 +9,7 @@
 
         .export        _open, closedirect, freebuffer
         .export        __filetype, __auxtype
-        .destructor    closeallfiles, 17
+        .destructor    closeallfiles, 5
 
         .import                pushname, popname
         .import                iobuf_alloc, iobuf_free
index ee662838144c7c2de5751a3ac5624486080fd538..aeeee44e9353d9d53fabeba186cf16103e054866 100644 (file)
@@ -10,7 +10,7 @@
        .include "fd.inc"
 
        .export _open
-        .destructor     closeallfiles, 17
+        .destructor     closeallfiles, 5
 
        .import _close
        .import clriocb
index 0d167a844adda158f85a5f59286a399d0c00a13d..df66345931981c7ac62fc2baba573961c5fb79c2 100644 (file)
@@ -9,7 +9,7 @@
 
 
         .export         _open
-        .destructor     closeallfiles, 17
+        .destructor     closeallfiles, 5
 
         .import         SETLFS, OPEN, CLOSE
         .import         addysp, popax
@@ -100,7 +100,7 @@ parmok: jsr     popax           ; Get flags
 
 ; Error entry. Sets _errno, clears _oserror, returns -1
 
-seterrno:                    
+seterrno:
         jmp     __directerrno
 
 ; Error entry: Close the file and exit. OS error code is in A on entry
index b66cce8e8d312d262d88886021b9bbb621ba96c8..7bb063306e83c8121f5b7395c4a946738b743fe9 100644 (file)
@@ -5,7 +5,7 @@
 ;
 
        .export         _atexit
-               .destructor     doatexit, 5
+               .destructor     doatexit, 17
        .import         callax
 
        .include        "errno.inc"