newlib: rework console initialization.

git-svn-id: svn://kolibrios.org@6074 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2016-01-18 17:02:08 +00:00
parent 36d7425fb6
commit adda605e2e
8 changed files with 29 additions and 45 deletions

View File

@@ -29,8 +29,12 @@ struct app_hdr
int stacktop;
char *cmdline;
char *path;
int __subsystem__;
};
void __init_conio();
void __fini_conio();
extern int main (int, char **, char **);
/* NOTE: The code for initializing the _argv, _argc, and environ variables
@@ -177,6 +181,8 @@ __crt_startup (void)
init_reent();
init_stdio();
if(header->__subsystem__ == 3)
__init_conio();
if( header->cmdline[0] != 0)
{
@@ -196,6 +202,9 @@ __crt_startup (void)
retval = main(argc, argv, NULL);
done:
if(header->__subsystem__ == 3)
__fini_conio();
exit (retval);
}