From 33c789303fcd9f8a6631218e4241947b6f5d7579 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 26 Mar 2012 10:43:06 +0000 Subject: * libc/stdio/findfp.c (__sinit): Set __sdidinit last. --- newlib/ChangeLog | 4 ++++ newlib/libc/stdio/findfp.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 869952b9f..d7d92aa1a 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2012-03-26 Corinna Vinschen + + * libc/stdio/findfp.c (__sinit): Set __sdidinit last. + 2012-03-09 Jeff Johnston * libc/include/machine/setjmp-dj.h: Modify license to include diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 570fd457e..d81241434 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -192,7 +192,6 @@ _DEFUN(__sinit, (s), /* make sure we clean up on exit */ s->__cleanup = _cleanup_r; /* conservative */ - s->__sdidinit = 1; s->__sglue._next = NULL; #ifndef _REENT_SMALL @@ -224,6 +223,8 @@ _DEFUN(__sinit, (s), when the underlying fd 2 is write-only. */ std (s->_stderr, __SRW | __SNBF, 2, s); + s->__sdidinit = 1; + __sinit_lock_release (); } -- cgit v1.2.3