1
0
mirror of https://github.com/adtools/clib2.git synced 2026-05-05 12:46:46 +00:00

- The stdio destructor no longer resets the __iob pointer to NULL. This

avoids trouble with destructor functions which use stdio code. Unsolved
  problem: the order in which destructors and constructors are called.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14870 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-09 16:56:05 +00:00
parent ee556fcb35
commit 4d3dc4a77f
2 changed files with 7 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
# #
# $Id: GNUmakefile.os4,v 1.37 2005-03-09 10:48:58 obarthel Exp $ # $Id: GNUmakefile.os4,v 1.38 2005-03-09 16:56:04 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -113,7 +113,7 @@ WARNINGS = \
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE) INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
OPTIONS = -D__THREAD_SAFE -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames OPTIONS = -D__THREAD_SAFE -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
OPTIMIZE = -O -fomit-frame-pointer -funroll-loops OPTIMIZE = -O -fomit-frame-pointer -funroll-loops
#DEBUG = -g DEBUG = -g2
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(CODE_TYPE) $(INCLUDES) CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(CODE_TYPE) $(INCLUDES)

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_init_exit.c,v 1.24 2005-03-07 11:16:43 obarthel Exp $ * $Id: stdio_init_exit.c,v 1.25 2005-03-09 16:56:05 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -58,7 +58,7 @@ __close_all_files(void)
__stdio_lock(); __stdio_lock();
if(__iob != NULL && __num_iob > 0) if(__num_iob > 0)
{ {
for(i = 0 ; i < __num_iob ; i++) for(i = 0 ; i < __num_iob ; i++)
{ {
@@ -66,11 +66,10 @@ __close_all_files(void)
fclose((FILE *)__iob[i]); fclose((FILE *)__iob[i]);
} }
__num_iob = 0; __num_iob = 0;
__iob = NULL;
} }
if(__fd != NULL && __num_fd > 0) if(__num_fd > 0)
{ {
for(i = 0 ; i < __num_fd ; i++) for(i = 0 ; i < __num_fd ; i++)
{ {
@@ -78,8 +77,7 @@ __close_all_files(void)
close(i); close(i);
} }
__num_fd = 0; __num_fd = 0;
__fd = NULL;
} }
__stdio_unlock(); __stdio_unlock();