[Midnightbsd-cvs] src [10549] trunk/lib/libc/stdlib/exit.c: clean up thread local destructors

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 7 20:44:36 EDT 2018


Revision: 10549
          http://svnweb.midnightbsd.org/src/?rev=10549
Author:   laffer1
Date:     2018-06-07 20:44:35 -0400 (Thu, 07 Jun 2018)
Log Message:
-----------
clean up thread local destructors

Modified Paths:
--------------
    trunk/lib/libc/stdlib/exit.c

Modified: trunk/lib/libc/stdlib/exit.c
===================================================================
--- trunk/lib/libc/stdlib/exit.c	2018-06-08 00:43:51 UTC (rev 10548)
+++ trunk/lib/libc/stdlib/exit.c	2018-06-08 00:44:35 UTC (rev 10549)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -10,7 +11,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -31,7 +32,7 @@
 static char sccsid[] = "@(#)exit.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/lib/libc/stdlib/exit.c 304527 2016-08-20 12:26:44Z kib $");
 
 #include "namespace.h"
 #include <stdlib.h>
@@ -64,6 +65,12 @@
 
 	_thread_autoinit_dummy_decl = 1;
 
+	/*
+	 * We're dealing with cleaning up thread_local destructors in the case of
+	 * the process termination through main() exit.
+	 * Other cases are handled elsewhere.
+	 */
+	__cxa_thread_call_dtors();
 	__cxa_finalize(NULL);
 	if (__cleanup)
 		(*__cleanup)();



More information about the Midnightbsd-cvs mailing list