File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1818;--------------------------------------------------------------------------
1919; closeallfiles: Close all open files.
2020
21- .section .fini,"axR" ,@progbits
21+ ; This must happen after fclosing all stdio files.
22+
23+ .section .fini.200 ,"axR" ,@progbits
2224closeallfiles:
2325
2426 ldx #MAX_FDS-1
Original file line number Diff line number Diff line change 2323;--------------------------------------------------------------------------
2424; initstdout: Open the stdout and stderr file descriptors for the screen.
2525
26- .section .init,"aR " ,@progbits
26+ .section .init,"axR " ,@progbits
2727 jsr initstdout
2828
2929.text
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ FILE *stderr = &serr;
6161
6262static FILE * filelist = & sin ;
6363
64- asm(".section .fini,\"axR\",@progbits\n"
64+ // This must happen before all POSIX open files are closed.
65+ asm(".section .fini.100,\"axR\",@progbits\n"
6566 " jsr _stdio_closeall\n" );
6667
6768void _stdio_closeall (void ) {
You can’t perform that action at this time.
0 commit comments