From a3c61f5039362586fcee6369153331cc738ed38c Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Thu, 3 Nov 2016 19:02:07 +0000 Subject: [PATCH] newlib: close streams on exit git-svn-id: svn://kolibrios.org@6664 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/sources/newlib/libc/crt/crt1.c | 4 ++-- contrib/sdk/sources/newlib/libc/crt/crtdll.c | 4 ++-- contrib/sdk/sources/newlib/libc/reent/getreent.c | 2 +- contrib/sdk/sources/newlib/libc/reent/init_reent.c | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/contrib/sdk/sources/newlib/libc/crt/crt1.c b/contrib/sdk/sources/newlib/libc/crt/crt1.c index efa04e6e7c..0c5935311c 100644 --- a/contrib/sdk/sources/newlib/libc/crt/crt1.c +++ b/contrib/sdk/sources/newlib/libc/crt/crt1.c @@ -27,7 +27,7 @@ struct app_hdr int __subsystem__; }; -extern void init_reent(); +extern void init_global_reent(); extern void init_stdio(); extern void __init_conio(); extern void __fini_conio(); @@ -173,7 +173,7 @@ __libc_init (void) int argc; tls_init(); - init_reent(); + init_global_reent(); init_stdio(); if(header->__subsystem__ == 3) diff --git a/contrib/sdk/sources/newlib/libc/crt/crtdll.c b/contrib/sdk/sources/newlib/libc/crt/crtdll.c index 7579eed20f..0ee1d372fd 100644 --- a/contrib/sdk/sources/newlib/libc/crt/crtdll.c +++ b/contrib/sdk/sources/newlib/libc/crt/crtdll.c @@ -37,7 +37,7 @@ struct app_hdr extern void _pei386_runtime_relocator (void); extern void init_loader(void *libc_image); -extern void init_reent(void); +extern void init_global_reent(void); extern void init_stdio(void); extern void __init_conio(void); @@ -182,7 +182,7 @@ void libc_crt_startup (void *libc_base) _pei386_runtime_relocator(); tls_init(); - init_reent(); + init_global_reent(); init_stdio(); if(header->__subsystem__ == 3) diff --git a/contrib/sdk/sources/newlib/libc/reent/getreent.c b/contrib/sdk/sources/newlib/libc/reent/getreent.c index 530debb907..0987729471 100644 --- a/contrib/sdk/sources/newlib/libc/reent/getreent.c +++ b/contrib/sdk/sources/newlib/libc/reent/getreent.c @@ -13,7 +13,7 @@ void init_reent() ent = user_alloc(sizeof(struct _reent)); - _REENT_INIT_PTR(ent); + _REENT_INIT_PTR_ZEROED(ent); __asm__ __volatile__( "movl %0, %%fs:16" diff --git a/contrib/sdk/sources/newlib/libc/reent/init_reent.c b/contrib/sdk/sources/newlib/libc/reent/init_reent.c index 60fd04a078..0762993d56 100644 --- a/contrib/sdk/sources/newlib/libc/reent/init_reent.c +++ b/contrib/sdk/sources/newlib/libc/reent/init_reent.c @@ -8,11 +8,8 @@ void init_global_reent() ent =_GLOBAL_REENT; - _REENT_INIT_PTR(ent); - __asm__ __volatile__( "movl %0, %%fs:16" ::"r"(ent)); -// __sinit(ent); }