From a9990fbcf3efe03370e416e7f2fefcd610f6a8d3 Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 28 Jan 2011 10:55:03 +0000 Subject: [PATCH] Changed priorities of destructors so atexit will be called before open files 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 | 2 +- libsrc/atari/open.s | 2 +- libsrc/cbm/open.s | 4 ++-- libsrc/common/atexit.s | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsrc/apple2/open.s b/libsrc/apple2/open.s index 2e867a66f..e7f603aa5 100644 --- a/libsrc/apple2/open.s +++ b/libsrc/apple2/open.s @@ -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 diff --git a/libsrc/atari/open.s b/libsrc/atari/open.s index ee6628381..aeeee44e9 100644 --- a/libsrc/atari/open.s +++ b/libsrc/atari/open.s @@ -10,7 +10,7 @@ .include "fd.inc" .export _open - .destructor closeallfiles, 17 + .destructor closeallfiles, 5 .import _close .import clriocb diff --git a/libsrc/cbm/open.s b/libsrc/cbm/open.s index 0d167a844..df6634593 100644 --- a/libsrc/cbm/open.s +++ b/libsrc/cbm/open.s @@ -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 diff --git a/libsrc/common/atexit.s b/libsrc/common/atexit.s index b66cce8e8..7bb063306 100644 --- a/libsrc/common/atexit.s +++ b/libsrc/common/atexit.s @@ -5,7 +5,7 @@ ; .export _atexit - .destructor doatexit, 5 + .destructor doatexit, 17 .import callax .include "errno.inc" -- 2.39.5