1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

c.lib 1.177 (29.9.2004)

- Moved the locale initialization/cleanup code into constructors
  and destructors.

- The socket cleanup function is now a destructor.

- The math cleanup function is now a destructor.

- The wildcard cleanup function is now a destructor.

- The stdio cleanup function is now a destructor.

- The stack extension cleanup function is now a destructor.

- The code that cleans up after the program's current directory
  was changed is now a destructor function.

- Moved the initialization/cleanup code for unlink() into constructors
  and destructors.

- Moved the initialization/cleanup code for usergroup.library into
  constructors and destructors.

- Added usleep(), and created wrapper code that both sleep() and
  usleep() can use.

- Added strtoll() and strtoull(), with further changes to <limits.h>
  and <stdlib.h>.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14737 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-09-29 14:17:46 +00:00
parent 53bb602493
commit 8555296691
44 changed files with 239 additions and 341 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: unistd_init_exit.c,v 1.4 2004-09-29 12:10:29 obarthel Exp $
* $Id: unistd_init_exit.c,v 1.5 2004-09-29 14:17:44 obarthel Exp $
*
* :ts=4
*
@ -41,21 +41,25 @@
/****************************************************************************/
int
__unistd_init(void)
/* Names of files and directories to delete when shutting down. */
struct MinList __unlink_list;
/****************************************************************************/
CLIB_CONSTRUCTOR(__unistd_init)
{
ENTER();
NewList((struct List *)&__unlink_list);
RETURN(OK);
return(OK);
CONSTRUCTOR_SUCCEED();
}
/****************************************************************************/
void
__unistd_exit(void)
CLIB_DESTRUCTOR(__unistd_exit)
{
ENTER();
@ -66,6 +70,9 @@ __unistd_exit(void)
struct UnlinkNode * uln;
BPTR old_dir;
/* Close all the files that still might be open. */
__close_all_files();
while((uln = (struct UnlinkNode *)RemHead((struct List *)&__unlink_list)))
{
old_dir = CurrentDir(uln->uln_Lock);
@ -80,23 +87,6 @@ __unistd_exit(void)
}
}
if(__current_directory_changed)
{
BPTR old_dir;
old_dir = CurrentDir(__original_current_directory);
__original_current_directory = ZERO;
if(__unlock_current_directory)
{
UnLock(old_dir);
__unlock_current_directory = FALSE;
}
__current_directory_changed = FALSE;
}
PROFILE_ON();
LEAVE();