This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: egcs 10-31 and UnixWare


> > I got the same result as Linux on Windows NT 4.0 with VC++ 5.0.
> > However I can change Linux to whatever behaviorw which makes
> > more senses.
> > 
> > How about call everyone on the list and use the status in the
> > last exit () call? BTW, it seems to be what happens on Solaris.
> 
> I'll leave that to you, H.J.  
> 

The patch is very trivial. I am enclosing one here for libc 5 in
case that anyone cares. I have sent a similar one to glibc 2.


H.J.
--
Index: stdlib/exit.c
===================================================================
RCS file: /home/work/cvs/linux/libc/stdlib/exit.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 exit.c
--- exit.c	1995/02/18 05:33:30	1.1.1.1
+++ exit.c	1997/11/10 19:44:51
@@ -36,14 +36,12 @@
 void
 DEFUN(exit, (status), int status)
 {
-  register CONST struct exit_function_list *l;
-
-  for (l = __exit_funcs; l != NULL; l = l->next)
+  for (; __exit_funcs; __exit_funcs = __exit_funcs->next)
     {
-      register size_t i = l->idx;
-      while (i-- > 0)
+      while ((__exit_funcs->idx)-- > 0)
 	{
-	  CONST struct exit_function *CONST f = &l->fns[i];
+	  CONST struct exit_function *CONST f
+		= &__exit_funcs->fns[__exit_funcs->idx];
 	  switch (f->flavor)
 	    {
 	    case ef_free:


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