diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-09-03 14:35:14 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-09-04 17:33:51 +0100 |
commit | 2088016394a3e0cecbddda97ac71a895ae8513ff (patch) | |
tree | a10fb2e559fa382070e4f7f856ce9a60dc7b1d59 /com32/lib/Makefile | |
parent | d1d03dee6bc961b0afd8dfc68fd35772ecded8be (diff) | |
download | syslinux-2088016394a3e0cecbddda97ac71a895ae8513ff.tar.gz |
console: Close stdin, stdout, stderr on ldlinux.c32 unload
The location of __file_info[] and ansicon_counter are split between
the core and ldlinux.c32. We can end up calling __ansicon_close (from
fp->oop->close) in the process of reloading ldlinux.c32, and while
ansicon_counter is set to its initialised data value of 0 when
reloading ldlinux.c32, the core is never reloaded, and so
__file_info[] retains its pointers.
What this amounts to is that when ldlinux.c32 tries to call
openconsole() after being reloaded, the core tries to close the
ansicon device (the core still has pointers to __ansicon_close)
despite the ansicon code having no knowledge of ever being opened
(because ansicon_counter was reinitialised).
The most logical way to deal with this is to close stdin, stdout and
stderr when unloading ldlinux.c32.
It also turns out that sys/openconsole.o was present in two Makefile
variables which lead to duplication of code, data, etc. We only need
it present in libcom32min.a and not in the core since the core never
handles opening consoles, at least not now that we've deleted
printf_init() which is safe because we always open a console in
ldlinux.c32 anyway.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib/Makefile')
-rw-r--r-- | com32/lib/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/lib/Makefile b/com32/lib/Makefile index 5d270a49..fc5defc5 100644 --- a/com32/lib/Makefile +++ b/com32/lib/Makefile @@ -170,7 +170,7 @@ CORELIBOBJS = \ sprintf.o strlcat.o strchr.o strlcpy.o strncasecmp.o ctypes.o \ fputs.o fwrite2.o fwrite.o fgetc.o fclose.o errno.o lmalloc.o \ sys/err_read.o sys/err_write.o sys/null_read.o \ - sys/stdcon_write.o sys/openconsole.o \ + sys/stdcon_write.o \ syslinux/memscan.o strrchr.o \ libgcc/__ashldi3.o libgcc/__udivdi3.o \ libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \ |