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

- When the main() function returns directly or indirectly by way of

calling exit(), the IoErr() value set at this time will now be
  preserved until the program really returns control to the shell.
  This turned out to be easier to implement than I had originally
  thought, thanks to the fact that the atexit() functions are all
  invoked straight after the exit() call.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15032 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-09-28 10:28:38 +00:00
parent f84fbc32cb
commit 095a14bf1f
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,10 @@
- When the main() function returns directly or indirectly by way of
calling exit(), the IoErr() value set at this time will now be
preserved until the program really returns control to the shell.
This turned out to be easier to implement than I had originally
thought, thanks to the fact that the atexit() functions are all
invoked straight after the exit() call.
- strtoimax(), strtoumax(), strtod(), strtof(), strtol(), strtoll(),
strtoul() and strtoull() now count how many digits were converted.
If that number is zero, then the conversion is considered to have

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_main.c,v 1.26 2005-09-04 07:38:51 obarthel Exp $
* $Id: stdlib_main.c,v 1.27 2005-09-28 10:28:38 obarthel Exp $
*
* :ts=4
*
@ -73,6 +73,8 @@ BOOL NOCOMMON __stack_overflow;
STATIC int
call_main(void)
{
volatile LONG saved_io_err;
ENTER();
/* This plants the return buffer for _exit(). */
@ -128,6 +130,9 @@ call_main(void)
out:
/* Save the current IoErr() value in case it is needed later. */
saved_io_err = IoErr();
/* Switch off function name printing, if it was enabled. */
__hide_profile_names();
@ -171,6 +176,9 @@ call_main(void)
SHOWMSG("done.");
/* Restore the IoErr() value before we return. */
SetIoErr(saved_io_err);
RETURN(__exit_value);
return(__exit_value);
}