2005-02-08 Antony King <antony.king@st.com>
* arm/syscalls.c: Change CHECK_INIT to pass reentrant struct instead of file pointer.
This commit is contained in:
parent
01d9b1612c
commit
1d7dd82d69
|
@ -1,3 +1,8 @@
|
||||||
|
2005-02-08 Antony King <antony.king@st.com>
|
||||||
|
|
||||||
|
* arm/syscalls.c: Change CHECK_INIT to pass reentrant struct
|
||||||
|
instead of file pointer.
|
||||||
|
|
||||||
2005-02-01 Hans-Peter Nilsson <hp@axis.com>
|
2005-02-01 Hans-Peter Nilsson <hp@axis.com>
|
||||||
|
|
||||||
* cris/Makefile.in (ALL_INSTALL_FILES): New macro.
|
* cris/Makefile.in (ALL_INSTALL_FILES): New macro.
|
||||||
|
|
|
@ -55,20 +55,17 @@ register char * stack_ptr asm ("sp");
|
||||||
|
|
||||||
/* following is copied from libc/stdio/local.h to check std streams */
|
/* following is copied from libc/stdio/local.h to check std streams */
|
||||||
extern void _EXFUN(__sinit,(struct _reent *));
|
extern void _EXFUN(__sinit,(struct _reent *));
|
||||||
#define CHECK_INIT(fp) \
|
#define CHECK_INIT(ptr) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if ((fp)->_data == 0) \
|
if ((ptr) && !(ptr)->__sdidinit) \
|
||||||
(fp)->_data = _REENT; \
|
__sinit (ptr); \
|
||||||
if (!(fp)->_data->__sdidinit) \
|
} \
|
||||||
__sinit ((fp)->_data); \
|
|
||||||
} \
|
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
/* Adjust our internal handles to stay away from std* handles. */
|
/* Adjust our internal handles to stay away from std* handles. */
|
||||||
#define FILE_HANDLE_OFFSET (0x20)
|
#define FILE_HANDLE_OFFSET (0x20)
|
||||||
|
|
||||||
static int std_files_checked;
|
|
||||||
static int monitor_stdin;
|
static int monitor_stdin;
|
||||||
static int monitor_stdout;
|
static int monitor_stdout;
|
||||||
static int monitor_stderr;
|
static int monitor_stderr;
|
||||||
|
@ -119,13 +116,8 @@ do_AngelSWI (int reason, void * arg)
|
||||||
static int
|
static int
|
||||||
remap_handle (int fh)
|
remap_handle (int fh)
|
||||||
{
|
{
|
||||||
if (!std_files_checked)
|
CHECK_INIT(_REENT);
|
||||||
{
|
|
||||||
CHECK_INIT(stdin);
|
|
||||||
CHECK_INIT(stdout);
|
|
||||||
CHECK_INIT(stderr);
|
|
||||||
std_files_checked = 1;
|
|
||||||
}
|
|
||||||
if (fh == STDIN_FILENO)
|
if (fh == STDIN_FILENO)
|
||||||
return monitor_stdin;
|
return monitor_stdin;
|
||||||
if (fh == STDOUT_FILENO)
|
if (fh == STDOUT_FILENO)
|
||||||
|
|
Loading…
Reference in New Issue