mirror of
https://github.com/adtools/clib2.git
synced 2026-09-25 02:18:35 +00:00
- Rewrote the code that allocates the file descriptor and file
buffer tables so that all the memory allocations are in one place and it's possible to specify exactly how many table entries are required at a time. - Creation and initialization of semaphores now uses the AmigaOS4 specific functions for this purpose, if available. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14857 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_init_exit.c,v 1.22 2005-03-03 14:20:55 obarthel Exp $
|
||||
* $Id: stdio_init_exit.c,v 1.23 2005-03-04 09:07:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -131,36 +131,12 @@ __stdio_init(void)
|
||||
if(__stdio_lock_init() < 0)
|
||||
goto out;
|
||||
|
||||
__iob = malloc(sizeof(*__iob) * num_standard_files);
|
||||
if(__iob == NULL)
|
||||
if(__grow_iob_table(num_standard_files) < 0)
|
||||
goto out;
|
||||
|
||||
for(i = 0 ; i < num_standard_files ; i++)
|
||||
{
|
||||
__iob[i] = malloc(sizeof(*__iob[i]));
|
||||
if(__iob[i] == NULL)
|
||||
goto out;
|
||||
|
||||
memset(__iob[i],0,sizeof(*__iob[i]));
|
||||
}
|
||||
|
||||
__num_iob = num_standard_files;
|
||||
|
||||
__fd = malloc(sizeof(*__fd) * num_standard_files);
|
||||
if(__fd == NULL)
|
||||
if(__grow_fd_table(num_standard_files) < 0)
|
||||
goto out;
|
||||
|
||||
for(i = 0 ; i < num_standard_files ; i++)
|
||||
{
|
||||
__fd[i] = malloc(sizeof(*__fd[i]));
|
||||
if(__fd[i] == NULL)
|
||||
goto out;
|
||||
|
||||
memset(__fd[i],0,sizeof(*__fd[i]));
|
||||
}
|
||||
|
||||
__num_fd = num_standard_files;
|
||||
|
||||
/* Now initialize the standard I/O streams (input, output, error). */
|
||||
for(i = STDIN_FILENO ; i <= STDERR_FILENO ; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user