This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to fix exit()'s atexit loop


Approved by Jeff & installed.

Richard


	* libc/stdlib/exit.c (exit): Handle null _GLOBAL_REENT->_atexits.

Index: libc/stdlib/exit.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/exit.c,v
retrieving revision 1.6
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.6 exit.c
--- libc/stdlib/exit.c	5 Sep 2003 18:22:00 -0000	1.6
+++ libc/stdlib/exit.c	22 Oct 2003 08:44:06 -0000
@@ -83,7 +83,7 @@ _DEFUN (exit, (code),
     }
 #else
   p = _GLOBAL_REENT->_atexit;
-  do
+  while (p)
     {
       args = & p->_on_exit_args;
   
@@ -95,7 +95,6 @@ _DEFUN (exit, (code),
 
       p = p->_next;
     }
-  while (p);
 #endif
 
   if (_GLOBAL_REENT->__cleanup)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]